Re: Can kernel threads be implemented using rfork?

[ Available lists | Index of freebsd-hackers | Month of Dec 2000 | Week of 12 Dec 2000 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Alfred Perlstein <bright@wintelcom.net>
Date
12 Dec 2000 02:29:11
Subject
Re: Can kernel threads be implemented using rfork?
Message-ID
20001212022832.C16205@fw.wintelcom.net

References to

[ Hide this part ]
* Satyajeet Seth <sseth@sasken.com> [001212 02:21] wrote:
> Hi
>
> Is it possible to implement threads in FreeBSD 4.0 kernel using the rfork
> system call? If yes, could you give an example?
>
>
> I tried to get the following piece of code to work without success.
>
> #include <unistd.h>
> main()
> {
> if (rfork( RFPROC | RFNOWAIT | RFMEM | RFSIGSHARE ) > 0)
> {
> while(1)
> printf ("Parent process's pid = %d\n", getpid());
> }
> while(1)
> printf ("Child process's pid = %d\n", getpid());
> }

Use the linuxthreads port and you'll save yourself a lot of
work.

Btw, this question gets asked once or twice a week on this list,
you should check the archives before posting to -hackers.

--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


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



Elapsed time: 0.154 seconds