MP3-plugin problems with slow cpu

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

 



Martin Cap wrote:
> Clemens Kirchgatterer wrote:
> 
>>> Martin Cap <macap20001@xxxxxxxxxxxxx> wrote:
>>>
>>>> Today I tried to set O_NONBLOCK to the open()-calls (the code does a
>>>>
>>>> "do{ r = read(...); }while(r!=-1 && r != EINTR);" at stream.c:271
>>>
>>>
>>> shouldn't it be: while(r!=-1 && errno != EINTR); ?
>>
>>
>> when i think about it, i'd rather do {
>>     r = read(...);
>> } while (r >= 0 || ((r < 0) && (errno == EINTR)));
>>
>> b.t.w. doesn't that eat cpu like crazy when O_NONBLOCK is set?
>>
> 
> Sure it does.

How about putting in a sched_yield() or usleep() call then?

Carsten.


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux