tech-userlevel archive

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

Re: Should we use _malloc_prefork and _malloc_postfork?

Mouse <mouse%Rodents-Montreal.ORG@localhost> writes:

>> I think we should go one step further than using them, and override
>> fork() in libpthread so we can do similar things that the FreeBSD
>> pthread fork does to make sure that it is safer (like blocking
>> signals).
> I'd much rather try to solve it more generally.  Perhaps atfork(), akin
> to atexit()?  Or some linker magic so that each library wraps (in the
> "ld --wrap" sense) the next's definition of (in this case) fork?

See the fine man page: pthread_atfork(3), posix specified even.  (For
non-threaded, that isn't available, but threads are the root of all
these problems.)

Attachment: pgpmQQi_DodmT.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index