Elena Laskavaia
07/24/2008 11:45 AM
post10939
|
Thanks, this is useful. I guess it is the same for read and write. Chances of process being hit by SIGSTOP during
processing of open is slim by possible. The other option I guess to re-implement client to use "thread-per-file"
approach - in this case if it blocked on one file at least it can be used with other files (which is the actual problem
now - deadlock while debugging the program using qconn which blocks on resource manager which is being debugged).
|
|
|
Thomas Fletcher
07/28/2008 9:04 AM
post11137
|
Colin Burgess wrote:
> O_NONBLOCK doesn't impose a limit on the processing of the open request - it imposes a limit on how long the open can
block
> AFTER the open has actually been processed.
>
> If the kernel or resource manager cannot process the open request, then O_NONBLOCK cannot help you.
>
> Really what you need in this case is a timeout on the send/reply states I guess, however that would involve a custom
> _connnect_* sequence which is not going to be trivial.
>
> Setting up a signal will unblock you if you are SEND blocked on the server, but if you are REPLY blocked it will
> simply send an unblock pulse to the server, and you will continue to be blocked.
>
True .. but in the case Elena is describing, that would be ok. Since
the open is where the blocking is occuring ... and we are presuming here
that it is in fact SEND blocked and not blocked internally somewhere
after being received ... then having the kernel kick the client back with
an error would be ok. If the server has already processed the request
(ie we are no longer talking about open, but read/write etc) then the
server should have an unblock handler and handle signalling requests
(not to mention O_NONBLOCK) properly.
Thomas
> Colin
>
> Elena Laskavaia wrote:
>
>> I have a resource manager for lets say /dev/xxx
>> My client opens file /dev/xxx for writing
>> open("/dev/xxx", O_WRONLY | O_NONBLOCK | O_CLOEXEC | O_NOCTTY)
>>
>> The problem is when resource manager is stopped (SIGSTOP) this call is hanging indefinitely.
>> If there any way to "open" it so if it cannot access resource manager it returns and sets errno to something like
EAGAIN?
>>
>>
>> _______________________________________________
>> OSTech
>> http://community.qnx.com/sf/go/post10934
>>
>>
>
>
|
|
|