Regarding spawning

Daniel Eischen deischen at freebsd.org
Thu Apr 19 05:43:17 UTC 2007


On Wed, 18 Apr 2007, Arunachalam wrote:
>> Hello ,
>>
>> Thanks for the reply.
>>
>> ya it is a minimal program. In the main, fork a  process, in the child and
>> parent , just the debug statements.
>>
>> ya , it fails all the time if i link lc_r.
>>
>> But when i link with lthr, the problem is not there, means it is able to
>> spawn.
>>
>> Is that any problem with lc_r, can i use this lthr for my application.

You need to provide a sample program.  There is little useful
information in what you provide above.

Also, the only purpose for forking from a multithreaded process
is to exec() another program.  See the POSIX spec for more
information.  The only functions you can call from the child,
aside from the exec() family of functions, are async-signal-safe
functions.  The behavior when calling any other functions is
undefined according to POSIX.  libc_r, libpthread, and probably
to some extent libthr will have undefined behavior if used in
this manner.

-- 
DE


More information about the freebsd-threads mailing list