Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Apr 1999 10:25:39 -0500
From:      "Richard Seaman, Jr." <dick@tar.com>
To:        hackers@freebsd.org
Subject:   Linuxthreads "port" status and a request
Message-ID:  <19990407102539.G467@tar.com>

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

The Linux threads "port" is designed to provide 1-1 native kernel pthreads
under FreeBSD.  The idea has been that this is a temporary stop gap solution
until FreeBSD gets it own kernel pthreads implementation, for those
who want kernel pthreads rather than the FreeBSD "user" pthreads.  The "port"
is available at http://lt.tar.com

It has now been about 3 weeks since the last reported bug in the Linux
threads "port".  It has received fairly heavy testing under stress, 
including some stress testing under SMP using Luoqi Chen's SMP vmspace
sharing patches.  That doesn't mean there might not be more bugs, but
its at least reasonably stable.

The tar ball of the "port" has now been downloaded more than 450 times,
though I'm sure the actual number of users is dramatically less than this.
Never-the-less, there are a number of users, and even some third party
products that now use it.

I'm prepared to submit the "port" to be committed to the ports tree
(assuming someone will commit it), but there is one key problem.  The Linux
threads pthread.h and semaphore.h headers conflict with the corresponding
FreeBSD headers.

Solution to header problem
--------------------------

After trying a variety of solutions, the consensus of the "port" users seems
to be that the best solution involves:

1) copying the existing pthread.h and pthread_np.h headers to a subdirectory
(I've proposed /usr/include/pthread/uthread -- in case the FreeBSD kernel
threads also produces a conflict, it could use /usr/include/pthread/kthread).

2) installing a new top level pthread.h that looks like:

#if defined(LINUXTHREADS) || defined(LINUXTHREAD)
#include </usr/local/include/pthread/linuxthreads/pthread.h>
#include </usr/local/include/pthread/linuxthreads/pthread_rw.h>
#include </usr/local/include/pthread/linuxthreads/pthread_stack.h>
#elif defined(UTHREADS) || defined(UTHREAD)
#include <pthread/uthread/pthread.h>
#else
#include <pthread/uthread/pthread.h>
#endif

3) making a comparable change pthread_np.h and patching semaphore.h
to #ifdef in the minor changes needed for linuxthreads

4) implementing the change by making appropriate fixes to the src tree
(I have patches to accomplish this). 

Request
-------

1) does any one have a better solution?
2) does any one object to this solution?
3) would someone be willing to commit the changes if I send the patches
or submit a new PR (I submitted PR 9778 on January 29, but the patches
there became obsolete on March 22).


Thanks. 

PS.  It would also be helpful, though not essential to also make the
following changes which I've recommended before:

1) Fix the posix priority extension functions (sched_*).  Peter
Dufault has developed patches to fix these which were "about to
be committed" a couple of months ago.

2) Make the posix priority extension functions the default, rather
than requiring a custom kernel.


These changes would also be very helpful to Linux emulation when
using linux pthreads.

-- 
Richard Seaman, Jr.           email: dick@tar.com
5182 N. Maple Lane            phone: 414-367-5450
Chenequa WI 53058             fax:   414-367-5852


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?19990407102539.G467>