Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Oct 1999 17:39:06 -0400 (EDT)
From:      Rohit Dube <rohitd@dnrc.bell-labs.com>
To:        hackers@freebsd.org
Subject:   threaded applications on freebsd 3.3
Message-ID:  <199910122139.RAA08377@zubin.dnrc.bell-labs.com>

next in thread | raw e-mail | index | archive | help
Hi,

Looking through the mailing list archives, support for threaded
applications wasn't quite clear to me so I ask here. I have a 
threaded application working on Red Hat Linux 6.0 which uses pthreads. 
I  was trying to port it over to FreeBSD 3.3 on a 2 processor intel machine. 
Not having done threaded work on FreeBSD before, I need to figure out what 
compiler-options/libraries/kernel to use for the port -

a) What do I need to do, to compile an application which uses pthreads
   on freebsd 3.3. The gcc (2.7.2.3) man page suggests that it should
   be invoked with -pthread. Is that sufficient or do I also need to recompile
   the standard libraries with DTHREAD_SAFE? How about with gcc295 
   (which comes on the 3.3 CD), it doesn't seem to have this option
   at all, going by the man page.
b) The mailing list archives seem to suggest that on freebsd (at least
   upto 3.2), a (p)thread doesn't map to a kernel thread. I.e scheduling
   of (p)threads in a process is done in user space.  Is there any way at 
   all to map a user-level thread to a kernel thread 1:1? Again there seems 
   to be -kthread option for gcc (2.7.2.3) but none for gcc295.
c) Is the generic 3.3 default kernel threaded and able to run a multiprocessor
   machine or do I need to build a custom kernel with specific options.

Sorry my freebsd is a bit rusty as I have been away for more than a year.
Thanks,
--rohit.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199910122139.RAA08377>