On Jul 1, 5:21 am, Andrew Piskorski <a...@piskorski.com> wrote:
> On Tue, Jun 29, 2010 at 06:19:06PM -0700, Sep Ng wrote:
> > How can I tell which ones are thread safe?  This sounds like something
> > I will need to look into before I start writing code.
>
> *All* AOLserver modules must be thread safe.  If they have any parts
> that are not, then that's clearly a bug which their developer
> overlooked, and needs to be fixed.
>
> Keep in mind however, that it's entirely possible for a module to call
> some external C library which happens to be completely thread-safe on
> one operating system, but horribly unsafe another.  All part of the
> "fun" of cross-platform programming...
>
This likely means that whatever issues I'm hitting will still happen
even with a rewrite.  Alright, I will try and take a closer look at
all of this.

> If you manage to find a list somewhere of what MS Windows library
> calls are or are not thread-safe, then you could use various tools to
> find ALL the calls in your AOLserver binaries, and compare the two
> lists to see if AOLserver seems to be calling anything unsafe.
>
> Unfortunately very few operating systems provide any such clear,
> consolidated documentation of what function calls are thread-safe
> vs. not.  You're lucky if the docs on each individual function call
> even tell you, and of course as Gustaf mentioned, occasionally those
> docs are wrong.
>
> My general impression though, is that historically MS Windows has
> tended to have a lot FEWER non-thread-safe library calls in use than
> Unix.  This is probably because Win32 was first written in an era when
> threads were very popular, while most versions of Unix have roots
> stretching back well before then.
>
> (Supposedly that's also why the multi-process support in Win32 has
> always been said to be lousy, but the success of multi-process Google
> Chrome on Win32 suggest that those problems have either been fixed, or
> can be effectively worked around.)
>
> > > I prefer libthread, since all such threads run in an event loop.
> > I don't think I've ever heard of this on Aolserver... I always thought
> > Aolserver's threads would eventually end up using the tcl+libthread
> > but it seems that there's a real difference in this.
>
> The Tcl Threads Extension's libthread was written AFTER AOLserver; in
> fact AOLserver is what inspired Zoran to write libthread in the first
> place.  Generally speaking, libthread is backwards compatible with
> AOLserver, but also includes some newer stuff that AOLserver does not.
>
> libthread is designed so that you can easily use it from inside
> AOLserver, including as a drop-in replacement for AOLserver's older
> nsv_* code.  It should be technically feasible to change AOLserver to
> use libthread directly, but no one has done the work.
>
> (And anyway, none of that has much of anything to do with your
> debugging problem.)
>
> > So typically the config file has no connection whatsoever to the
> > threads of aolserver and that it only pertains to the connection
> > threads, or am I confusing this even further?
>
> Your "the threads of aolserver" terminology above is certainly
> confused.  A "connection thread" is one of the various flavors of
> threads used in AOLserver.
>
Right.  Thanks for that clarification.  You guys have been
tremendously helpful in giving me such immensely informative posts so
this is all well appreciated.

> --
> Andrew Piskorski <a...@piskorski.com>http://www.piskorski.com/
>
> --
> AOLserver -http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to 
> <lists...@listserv.aol.com> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
> field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to