Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Nov 98 09:23:59 -0600
From:      "Richard Seaman, Jr." <lists@tar.com>
To:        "current@freebsd.org" <current@FreeBSD.ORG>
Subject:   Re: RFSIGSHARE ready?
Message-ID:  <199811111523.JAA04046@ns.tar.com>

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

==================BEGIN FORWARDED MESSAGE==================
>From: "Richard Seaman, Jr." <lists@tar.com>
>To: "Brian Feldman" <green@unixhelp.org>
>Cc: "current@freebsd." <current@freebsd.>
>Date: Wed, 11 Nov 98 09:19:25 -0600
>Reply-To: "Richard Seaman, Jr." <lists@tar.com>
>Subject: Re: RFSIGSHARE ready?
>

On Tue, 10 Nov 1998 21:22:05 -0500 (EST), Brian Feldman wrote:

>This doesn't necessarily sound like it's the last bug to be fixed, but it
>sure could be. Thanks a bunch!

I have a ported version of linuxthreads that executes in FreeBSD.
However, I haven't incorporated your RFSIGSHARE patches into the
kernel, so I'm sure the signal handling is not quite right.
It doesn't use the clone call, it just uses rfork instead.
It also uses thr_sleep and thr_wakeup instead of the restart
signal handling that linuxthreads uses for suspend and restart.
This gets around some of the signal handling problems in FreeBSD
vs. linux clone, and looks like it might be speedier.

It still needs work, but if this is related to what you're trying
to accomplish, I'll tar it up and send it to you, if you want.

Three issues you need to be aware of, at least.

1) There is something wrong with the definition of 
THREAD_STACK_START_ADDRESS in internals.h when executing in FreeBSD.  

Setting:

#define THREAD_STACK_START_ADDRESS (0xe0000000)

works, but there's probably a better choice.

2) The mmap call in manager.c uses an option MAP_GROWSDOWN that
doesn't seem to exist in FreeBSD.  The user stack appears way
too small (in fact I think its effectively zero length), since
I assume the MAP_GROWSDOWN option adds to the mmaped region on
demand as stack is needed.

What I have done, until I think of something better, is change 
the call to this:

   if (mmap((caddr_t)((char *)(new_thread+1) - STACK_SIZE),
            STACK_SIZE, PROT_READ | PROT_WRITE,            
            MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0)                
       != (caddr_t) -1) break;                             

3) There are numerous libc issues to be dealt with to make linuxthreads
work properly, though they are not unique to linuxthreads.  The same
issues apply to any pthreads implementation other than the existing
FreeBSD libc_r version.  When I have the issues clear in my own mind,
I was planning on posting a message.




===================END FORWARDED MESSAGE===================




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



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