>>>No. This is as it should be, because -lpthread does threads in *one*
>>>kernel process, so it has to intercept blocking operations so it can
>>>switch to another thread instead, or call select/poll/kevent if
>>>needed, so not all threads hang if *one* executes a blocking
>>>operation.
>>
>> How could I help the high CPU usage then? The device driver read
>> routine always prematurely exits because IO_NDELAY is set (and
>> there's nothing to read - so EWOULDBLOCK is returned).
>
>the real syscall symbols are available as _thread_sys_read and so on.
>you'll also need to clear non-blocking with _thread_sys_fcntl.
>

If I would now use _thread_sys_read and so on, then the main thread
would block (as expected), but due to the implementation, control is
not passed to other threads (because of blocking on _thread_sys_read())
as far as I understand.

It looks like I am not able to do threading and blocking at the same
time, that's where I am stuck.


Jan Engelhardt
-- 
| Software Engineer and Linux/Unix Network Administrator

Reply via email to