Message-ID: Date: Mon, 21 Aug 2006 13:47:00 +0200 From: "Dmitry Adamushko" Subject: [Xenomai-core] [patch, minor] xnpipe_recv and xntimer_get_timeout_periodic() In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_29284_9777557.1156160820117" References: <1156154538.4402.32.camel@domain.hid> <1156159631.4402.41.camel@domain.hid> List-Id: "Xenomai life and development \(bug reports, patches, discussions\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org ------=_Part_29284_9777557.1156160820117 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On Mon, 2006-08-21 at 12:47 +0200, Dmitry Adamushko wrote: > > > > what about pipe-related change (I mean timeslice updating in > > xnpipe_recv()) ? > > > > It's basically useless, since xnsynch_sleep_on() handles the resource > stealing case internally, and the loop in xnpipe_recv is fake actually. > Think of it as a goto statement in disguise. It has nothing to do with "resource stealing" (in terms of synch.c). The synch object is not PIP at all. task1 : blocked in xnpipe_recv() task2 : xnpipe_send() ---> wakes up task1 ---> task1 is waiting to be scheduled in task3 [prio > task2.prio] : gets CPU and calls xnpipe_recv() task3 gets a message so state->inq is empty now. ... task2 : calls getq(&state->inq) which is NULL now (if there were no more messages) calls xnsynch_sleep_on() again with the initial "timeout". No? > > > -- > Best regards, > Dmitry Adamushko -- Philippe. -- Best regards, Dmitry Adamushko ------=_Part_29284_9777557.1156160820117 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On Mon, 2006-08-21 at 12:47 +0200, Dmitry Adamushko wrote:
>
> what about pipe-related change (I mean timeslice updating in
> xnpipe_recv()) ?
>

It's basically useless, since xnsynch_sleep_on() handles the resource
stealing case internally, and the loop in xnpipe_recv is fake actually.
Think of it as a goto statement in disguise.

It has nothing to do with "resource stealing" (in terms of synch.c). The synch object is not PIP at all.

task1 : blocked in xnpipe_recv()

task2 : xnpipe_send() ---> wakes up task1 ---> task1 is waiting to be scheduled in

task3 [prio > task2.prio] : gets CPU and calls xnpipe_recv()

   task3 gets a message so state->inq is empty now.

...

task2 : calls getq(&state->inq) which is NULL now (if there were no more messages)

calls xnsynch_sleep_on() again with the initial "timeout".
 
No?



>
> --

> Best regards,
> Dmitry Adamushko
--
Philippe.





--
Best regards,
Dmitry Adamushko

------=_Part_29284_9777557.1156160820117--