[FFmpeg-devel] [PATCH] What is missing for working AVFMT_FLAG_NONBLOCK?
Tue Mar 3 18:05:28 CET 2009
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.
More information about the ffmpeg-devel