Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: [ANNOUNCE] vdr-softdevice-0.0.7pre2



On Donnerstag, 5. August 2004 12:37, Dr. Werner Fink wrote:
[ .. ]
>        As some applications  require  much  more  precise  pauses
>        (e.g.,  in  order to control some time-critical hardware),
>        nanosleep is also capable of short high-precision  pauses.
>        If  the process is scheduled under a real-time policy like
>        SCHED_FIFO or SCHED_RR, then pauses of up to 2 ms will  be
>        performed as busy waits with microsecond precision.
> 
> ...
> 
> In other words ... usleep(1 ... 2000) do _not_ trigger the scheduler
> to get other thread/processes at work, for this a simple sched_yield(2)
> or pthread_yield(no man page) should be used.

NO. I played around the usleep(1) in vd1.3.12 transfer.c line 127.
Using (kernel 2.4.27-pre5):
 phtread_yield() -> cpu 100%
 sched_yield() -> stream corrupted, every now and then some single blocks decoded.
 usleep(1) -> live stream plays fine.

So if "usleep(1)" is bad, it should be replaced by something other not yet mentioned. 


Stefan Lucke





Home | Main Index | Thread Index