Subject: Re: In search of further information about c-client and multi-threading...

From: "Doug Royer [N6AAW]" <[email-masked]>
Date: Thu, 20 Mar 1997 13:55:23 -0800 (PST)

> On Thu, 20 Mar 1997 11:42:39 -0800 (PST), Chris Newman wrote:
> > You're probably better off starting from scratch and just stealing the
> > good ideas from c-client (e.g. driver model, bezerk UID model, etc) if you
> > want a multi-threaded application.

Or just go through it an fix the mt-unsafe code.

> From: Mark Crispin <[email-masked]>
> The other option is to substitute your own thread-safe C library.

That is not the only problem. Many of the initialization assumptions
made in c-client are not mt-safe and would need to be wrapped
by something like pthread_once(), like the env_init() function
in env_unix.c.

  if (myUserName) fatal ("env_init called twice!",stream);

Not an MT-safe way of handling a problem. It is possible
that two threads calling myusername_full() could both
get past "if (!myUserName)" and call env_init(). Mutex locks
might be able to handle some of the problems. Others functions
would need to be rewritten.

I can come up with many examples like this in c-client. I am
not criticizing c-client. It was written before most OS's (including
Unix) had threads. And long before POSIX threads.