[Gc] I/O issues
ncannasse at motion-twin.com
Wed Sep 10 02:36:32 PDT 2008
>> We are still experiencing one last issue, which is related to
>> I/O functions.
>> In some rare cases, two of our threads get blocked in a I/O
>> function (either recv() , fread() , or __read_nocancel()).
>> The two threads are usually unrelated - one can be a MYSQL
>> response beeing read while the other is reading a file - but
>> they get blocked at the same time. Seems like a deadlock to me.
>> I wonder is there are some issues with multithreading + linux
>> IO + gc signals. Even if the EINTR return values would not be
>> handled everywhere, I guess it should still cause an error
>> and not cause the threads to block.
>> Any advice would be appreciated.
> I haven't encountered this. They are blocked even though input is available?
Yes. In case of files, we are blocked into fread() which calls read()
> There is no signal handler on the stack, and no sign of the GC being involved in a deadlock?
No, it seems that GC continue to run correctly since other threads are
> Does wrapping the call in GC_do_blocking() work around the problem?
I can try that, but it's a bit problematic to use this because the API
was changed between 6.x and 7.x and so if we compile your library to use
either version of the GC, it cannot be used with the other one (unless
we resolve dynamically GC_do_blocking or GC_start/end_blocking)
More information about the Gc