Subject: Re: scheduler activations problem ?
To: Mihai CHELARU <kefren@netbastards.org>
From: Stephan Uphoff <ups@stups.com>
List: current-users
Date: 10/20/2003 09:00:25
> Hi,
> 
> Well, there is a select in between that actually works and returns only 
> once / connection there. How do I know ?

No - select keeps on returning until the connection is accepted.
Since accepting the connection is done in another thread this
might not happen for a while - leaving your main thread free to
keep on creating new threads.


> 
> #ifdef DEBUG
>         printf("Socket1: %d %d\n", s, s1);
> #endif
> 
> I see that message only when a connection is established. Once. 
> Meanwhile I have 4500 lwps lurking..

4498 are waiting in accept and never get to the printf.
Try adding a printf before " s = accept((*(int *) (voidsoc)), NULL, NULL);" 


> 
> Thanks,
> Mihai
> P.S. I know the code is poor, I wrote it some years ago and I was trying 
> to recycle it quickly for another purpose. But poor code is usualy 
> exposing bugs :)
> 
> On Monday 20 October 2003 15:11, Daniel Carosone wrote:
> > On Mon, Oct 20, 2003 at 02:39:13PM +0300, Mihai CHELARU wrote:
> > > main()
> > > {
> >
> > ...
> >
> > >         for(;;) {
> >
> > ...
> >
> > >                 if (pthread_create(&pt, NULL, persocket, (void *)
> > > (&s)))
> >
> > ...
> >
> > I think this is your problem.
> >
> > --
> > Dan.
> 
> 
>