From owner-freebsd-hackers Wed Apr 7 8:27:42 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from ns.tar.com (ns.tar.com [204.95.187.2]) by hub.freebsd.org (Postfix) with ESMTP id A087914CE1 for ; Wed, 7 Apr 1999 08:27:38 -0700 (PDT) (envelope-from dick@ns.tar.com) Received: (from dick@localhost) by ns.tar.com (8.9.3/8.9.3) id KAA08734 for hackers@freebsd.org; Wed, 7 Apr 1999 10:25:39 -0500 (CDT) (envelope-from dick) Date: Wed, 7 Apr 1999 10:25:39 -0500 From: "Richard Seaman, Jr." To: hackers@freebsd.org Subject: Linuxthreads "port" status and a request Message-ID: <19990407102539.G467@tar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 #include #include #elif defined(UTHREADS) || defined(UTHREAD) #include #else #include #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