Jerry, that's a good alternative.  I did some investigation and it
looks like LinuxThreads doesn't support atttributes on condition
variables or on threads.  Posix threads supports the notion of
attributes on threads and synchronization variables, but the only
attribute they talk much about is the run-time scheduling attribute of
a process.  In this case, it's more an attribute of a condition
variable I think.  That's how you would specify something like "I want
processes to queue and wakeup this way".  Was hoping there was just
a flag somewhere to tweak.

Right now I'm not hugely concerned about getting threads to die.
Since several people talked about threads dying being part of the
memory increases, I thought it was important to mention that in
practice, the thread timeout mechanism doesn't work on a Linux server
getting 100K+ hits a day.  If a site averages 1 hit every
threadtimeout/maxthreads seconds (1 hit every 3 seconds in our case),
all of the threads will hang around.

Jim


>
> >This shows (I think) that if you currently have N threads active, no
> >threads will timeout if there are N hits in threadtimeout seconds, at
> >least on a Linux box, because the thread scheduling is FIFO instead of
> >LIFO.  On one of our production server, we are up to around 26 active
> >threads.  I don't think there is any value for threadtimeout that would
> >make threads actually time-out.
>
> That could be, I don't know how Linux wakes things up, BUT,
>
> >I dunno if there is a way to make Linux/pthreads/AS/... wakeup threads
> >in LIFO order instead of FIFO.  Anyone else know?
>
>  From what I recall of how threads are started and killed, well, if this is
> a concern of yours, then another way to skin that cat might to alter the
> logic in nsthread and conn.c maintaining a ratio of active threads to total
> threads, and to start killing threads off when the ratio becomes too low.
>
>
> Jerry
> ========================================================
> Jerry Asher                      [EMAIL PROTECTED]
> 1678 Shattuck Avenue Suite 161   Tel: (510) 549-2980
> Berkeley, CA 94709               Fax: (877) 311-8688
>

Reply via email to