Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Dec 2000 02:28:32 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Satyajeet Seth <sseth@sasken.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Can kernel threads be implemented using rfork?
Message-ID:  <20001212022832.C16205@fw.wintelcom.net>
In-Reply-To: <Pine.GSO.4.30.0012121534080.26823-100000@suns3.sasi.com>; from sseth@sasken.com on Tue, Dec 12, 2000 at 03:51:10PM %2B0530
References:  <Pine.GSO.4.30.0012121534080.26823-100000@suns3.sasi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* 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




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