From owner-freebsd-hackers Tue Oct 12 14:40:38 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from crufty.research.bell-labs.com (crufty.research.bell-labs.com [204.178.16.49]) by hub.freebsd.org (Postfix) with SMTP id E260214DE9 for ; Tue, 12 Oct 1999 14:40:07 -0700 (PDT) (envelope-from rohitd@zubin.dnrc.bell-labs.com) Received: from zubin.dnrc.bell-labs.com ([135.180.130.56]) by crufty; Tue Oct 12 17:39:07 EDT 1999 Received: (from rohitd@localhost) by zubin.dnrc.bell-labs.com (8.9.3/8.9.3) id RAA08377 for hackers@freebsd.org; Tue, 12 Oct 1999 17:39:06 -0400 (EDT) Date: Tue, 12 Oct 1999 17:39:06 -0400 (EDT) From: Rohit Dube Message-Id: <199910122139.RAA08377@zubin.dnrc.bell-labs.com> To: hackers@freebsd.org Subject: threaded applications on freebsd 3.3 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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