[FFmpeg-devel] [PATCH] What is missing for working AVFMT_FLAG_NONBLOCK?
Tue Mar 3 17:19:05 CET 2009
Michael Niedermayer wrote:
> On Tue, Mar 03, 2009 at 05:01:16PM +0100, Luca Abeni wrote:
>> Hi Michael,
>> Michael Niedermayer wrote:
>>>> I tested capturing some audio with the two attached patches (without them,
>>>> nothing changes...) and it seems to me that this is working (easy,,, I
>>>> only have a single input ;-). I see a near-100% CPU load, so I guess a
>>>> usleep() somewhere (or something similar) is really needed.
>>> sched_yield() should be added IMHO, usleep() just feels like the wrong thing
>> AFAIK, sched_yield() on non real-time task is not a good idea (it has an
>> undefined behaviour).
> which page of POSIX says that?, i cant find it ...
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).
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:
The problem is that (AFAIK) the concept of "head of its thread list" only
makes sense for fifo and rr.
More information about the ffmpeg-devel