From: Rob McCool <robm@netscape.com> Newsgroups: netscape.devs-nsapi Subject: Re: Question about creating a solaris thread in Service directive function. Date: Fri, 26 Jul 1996 17:48:22 -0700Satish Krishnaraj wrote: > I am using Fasttrack Server beta 3, with NSAPI plug ins. > I am overloading the Service functionality in the shared library. > > I am curious to know what will happen in the following scenario: > > In the service directive function, > if I create a thread (say thread A), and suppose I write data > (using net_write) from thread A, what are the consequences.
Are you creating the thread through NSAPI, or through the operating system.
> Source of this is because, if I do any of NSAPI functions, > say for ex., log_error from some thread (other than from > Netscape thread - service direction function), the child crashes. > > What could be the reason for this behavior?
The reason this might happen is that our threading system keeps more state than simply the operating system thread id. It stores a pointer to a smallish data structure in thread-specific data, and the NSAPI functions like log_error and such, if they perform I/O or attempt to get a lock may go looking for their current thread id. If your thread wasn't imported, then a crash or assert failure would be likely.
-- Rob McCool, robm@netscape.com http://home.netscape.com/people/robm/ Stunt Programmer, Netscape Communications Corporation It was working ten minutes ago, I swear...Reproduced by permission of the author.
Devoto comment: Note that Enterprise 2.01 uses native threads on Solaris.