
Hi Seth,
perhaps this will help you, some information from the implementation
side concerning your question about threadIDs:
Related code lived in rts/Schedule.c, has recently moved to
rts/Threads.* in the head.
The ThreadID assigned by the RTS is continuously increasing, and
declared to be StgInt32 (32 bits usually).
So you might get int overflows when running your server for a *fairly*
long time. OTOH, depending on what you want to do with the ThreadIDs
that forkIO returns, IMHO you could just *ignore* these overflows.
From your short description of how the servers work, you know an upper
bound on the no. of running threads (6), but not on their time to live.
So IMHO the worst case scenario would be:
a new thread for a client gets ID n
... 2^32 other server threads get spawned
another new thread for a client gets the same ID n again
...
one of the threads supposed to terminate (killThread n)
AFAICT, the killThread action will arbitrarily choose one of the two.
HTH
Jost
------ you wrote ------
Date: Tue, 20 Jun 2006 23:22:26 -0400
From: Seth Kurtzberg