This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Deadlock in multithreaded application when doing IO andfork.


On 02/01/2013 01:51 PM, Roland McGrath wrote:
>> The fix actually requires two things:
>> (a) Run all atfork prepare handlers.
>> (b) Lock list_all_lock to prevent more IO.
>> (c) After (b) run malloc atfork handler e.g. run handler last.
> 
> I don't understand the (b) requirement.  It's not required to fix the
> deadlock test case I described (there is no stdio use at all in that case).
> Whatever it's about, it seems like it should be a follow-up change after
> the basic change to run malloc atfork last.
 
Sorry, I didn't realize you were comparing the solution
against your particular strawman testcase.

You are correct, in that (b) is not required to fix
your testcase, but it is required to fix the deadlock
that I see with 3 threads stdio and malloc.

I have no problem breaking up the work into even
more chunks.

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]