[FFmpeg-devel] [PATCH] What is missing for working AVFMT_FLAG_NONBLOCK?

Michael Niedermayer michaelni
Tue Mar 3 19:19:54 CET 2009


On Tue, Mar 03, 2009 at 06:05:28PM +0100, Reimar D?ffinger wrote:
> On Tue, Mar 03, 2009 at 05:48:06PM +0100, Michael Niedermayer wrote:
> > > I think POSIX defines the sched_yield() behaviour only for SCHED_FIFO and
> > > SCHED_RR (basically, a task is moved at the end of its priority's queue).
> > > 
> > > opengroup.org says:
> > > The sched_yield() function shall force the running thread to relinquish the processor until it again becomes the head of its thread list. It takes no arguments:
> > > http://www.opengroup.org/onlinepubs/000095399/
> > > 
> > > The problem is that (AFAIK) the concept of "head of its thread list" only
> > > makes sense for fifo and rr.
> > 
> > are you saying that sched_yield() will blow up and cause actual undefined
> > behaviour and that we should use usleep(0) or what else?
> > I really feel that sched_yield() is correct and usleep() is not.
> > thats IMHO from reading POSIX and the man pages
> 
> As I understand it the issue is "near-100% CPU usage". In that case both
> are nonsense, and usleep(10000) or so comes closest to correct.

i feared such awnser ...
And i must say i really dont like it

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090303/b8de843c/attachment.pgp>



More information about the ffmpeg-devel mailing list