>Number:         1359
>Category:       general
>Synopsis:       MULTITHREADed code is not portable
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Tue Nov  4 19:10:01 PST 1997
>Last-Modified:
>Originator:     [EMAIL PROTECTED]
>Organization:
apache
>Release:        1.3b2
>Environment:
BeOS PR2 w/ mwcc
>Description:
BeOS sockets are currently "broken" in the same way as MS Windows:  they are not
equivalent to file descriptors, and aren't inherited across a fork().  While 
this may
be fixed in a future version of BeOS, it'd be nice to have Apache sooner than 
that.

To that end, I'm working on a port of Apache to BeOS using the MULTITHREAD code 
that was
written for Windows, and there are still a lot of WIN32 dependencies in the 
code.  I'd like
to coordinate with other developers who are working on getting this to work with
multithreaded UNIX, to separate out the Windows dependencies.

The first problem I ran into is thread-local storage, which is implemented 
(mostly in
main/http_main.c) with __declspec(thread) on WIN32.  Neither UNIX pthreads nor 
BeOS
offers such a simple fix.  In both cases, to minimize changes to the code, the 
affected
variables will probably need to be changed to a #define that calls a function to
retrieve a pointer to the allocated variable.  Something like:

#define my_pid (*(tls_my_pid()))

There are other problems in http_main.c as well:  the entire main() function 
has been gutted and reorganized in a not very portable fashion.  This should 
all be cleaned up.
>How-To-Repeat:

>Fix:
Yes, I'd like to coordinate with other developers interested in a multithreaded 
server
to fix the MULTITHREAD code in a portable fashion that works with UNIX and BeOS 
as well
as Win32
>Audit-Trail:
>Unformatted:

Reply via email to