You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "Pier P. Fumagalli" <pi...@betaversion.org> on 2001/07/31 04:12:20 UTC
FW: mod_webapp vs. multi-thread component.
Any clue??? :)
Pier
------ Forwarded Message
From: "Pier P. Fumagalli" <pi...@betaversion.org>
Organization: Apache Software Foundation
Reply-To: tomcat-dev@jakarta.apache.org
Date: Tue, 31 Jul 2001 01:52:31 +0100
To: <to...@jakarta.apache.org>
Subject: Re: mod_webapp vs. multi-thread component.
Thom Park at tpark@borland.com wrote:
>
> Pier et. al.
>
> I hope that someone more enlightened can assist me with this one as I'm
> totally flummoxed by this - this applies to Solaris threads being used within
> mod_webapp (but not directly)...
Whoha... Looking for troubles, huh? :)
> I have succesfully (yay!) built mod_webapp (and apr) using the native SUN C
> compiler on Solaris 2.8. I am now attempting to add my own provider to the mix
> and am hitting an odd problem that I need explained to me )or hit on the head
> with a stick - which ever is less painful ;-)
Uh... Any modification to the build process? I believe APR doesn't like the
native SUN-C compiler that much (ok, I work for Sun and I use GCC...
WHAT-EVERRRR! :)
> B.T.W. My 'provider' is an interface between apache and an IIOP (CORBA)
> connector that allows apache to converse with tomcat (using an IIOP java
> connector).
One of these days you'll enlighten me of the difference... I'm wondering why
you're using IIOP...
> (works champion on NT!).
Good :)
> Unfortunately I don't have a single-threaded version of the CORBA orb
> libraries - only multi-threaded are available. Note that from Apache's point
> of view this shouldn't be a problem as there only is one client per apache
> child - no callbacks are made between the client and server so the execution
> thread being used by apache should be the only one that invokes the (client)
> object reference.
>
> Unfortunately, due to the mechanism involved in binding to a corba object, the
> client lib spawns a bunch of thread so handle the looking up and resolving of
> the object reference. It is here that my problem occurs. The CORBA api call
> launches 5 or so threads a this point (mainly to service a try/retry object
> discovery role) and, for every call to thr_create() that's performed by the
> 'connect' code, I get the following message written to the apache log (things
> in <> paraphrased by me):
>
> [<apache timestamp>][notice] child pid <pidnum> exit signal Abort(6)
> thr_create: Inappropriate ioctl for device
> thr_create: Inappropriate ioctl for device
> thr_create: Inappropriate ioctl for device
> ...
Darn... Why would it be IOCTLing a device when creating a thread?
> I thought it might be that I hadn't put -lthread in the link line but that's
> even nastier - Apache doesn't even manage to startup if I do that.
Is it simply crashing or does it give some output?
> So - can anyone please! offer any advice on :
>
> a) what the above could mean
That's the weird part... Why is ioctl() called when a thread is created?
> b) any suggestions on using multi-threading apps (in a single threaded
> fashion) within mod_Webapp or apache.
I bet it would be the same if you created a module without APR and WEBAPP.
IMVHO, the problem is somewhere else... :(
Could this be something related to creating threads and using fork() at the
same time?
> p.s. Note that this isn't a problem per se with the mod_webapp connector -
> more an issue with the use of threading
> within Apache - so can anyone advise where i should post this request if not
> here?
I'm forwarding to apr-dev, lots of bright people over there, please, since
this is outside of the scope of APR, respond privately to me and/or Thom.
Thank you very much...
Pier
------ End of Forwarded Message
Re: FW: mod_webapp vs. multi-thread component.
Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Tue, Jul 31, 2001 at 03:12:20AM +0100, Pier P. Fumagalli wrote:
> Any clue??? :)
Some. I'd recommend using Apache 2.0 for this case because httpd-2.0
is already using threads (and sets up the compiler flags accordingly).
I have a feeling that he is compiling Apache 1.3/mod_webapp/apr
without _REENTRANT defined at compile-time, so bad things will happen
on Solaris when you try to create a thread at run-time.
Also, remember that there are two versions of the Solaris threading
libraries (apr would use pthread and his ORB would use thread).
However, the man pages say that they *should* be compatible even in
the same process. They even have an example in the man pages...
> > I thought it might be that I hadn't put -lthread in the link line but that's
> > even nastier - Apache doesn't even manage to startup if I do that.
>
> Is it simply crashing or does it give some output?
This leads me to believe that _REENTRANT isn't defined correctly at
compile-time. -- justin