Re: pthread_create in a forked child
rfr <[email protected]> Mon, 12 Aug 2002 11:11:32 +0200
| Newsgroups | gmane.linux.ngpt.user |
|---|---|
| Message-ID | <[email protected]> |
My program is already linked with pthread and ldd shows it is correctly
linked:
libpthread.so.20 => /usr/lib/libpthread.so.20 (0x4002c000)
libc.so.6 => /lib/i686/libc.so.6 (0x40070000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
Perhaps the wrong fork is called (the one of libc) as fork is also
exported in libpthread.
Regards,
Frederic Rouyre
Wojtek Meler wrote:
>Probably you forgot about -lpthread in gcc. I had the same problem few
>months ago - libpthread should call some piece of code after fork which
>save new pid in internal structures and it has to be passed to linker
>explicitly in final compilation.
>
>regards,
>Wojtek Meler
>
>On Sat, Aug 10, 2002 at 12:08:33AM +0200, rfr wrote:
>
>>Hello,
>>
>> I have installed linux kernel 2.4.19 with the futex patch and ngpt
>>2.0.0 and I have the following problem: a thread created by
>>pthread_create after a fork (so in the child) is blocked.
>>If I suppress the fork(), I have no problem and the thread runs correctly.
>>
>> An idea anyone ?
>>
>>Thanks, Regards,
>>
>>Frederic Rouyre
>>
>>_______________________________________________
>>pthreads-users mailing list
>>[email protected]
>>http://www-124.ibm.com/developerworks/oss/mailman/listinfo/pthreads-users
>>