Subj : Re: threaded application scalability question To : comp.programming.threads From : David Schwartz Date : Wed Feb 16 2005 08:35 am "Luke Ehresman" wrote in message news:1108569916.538515.250130@z14g2000cwz.googlegroups.com... > My question: Would it be reasonable to create a thread when a new > session is created (i.e. a new user logs in), and have that thread stay > active as long as the user is logged in. Reasonable, but very sub-optimal. > This thread would have a > session in its local context, and would do processing on that session > when the user isn't connected. There would be no global session > structures. When the user reconnects, he would get attached to the > existing thread for that session, and that thread would handle his > connection again. Eww. > Would this be a scalable solution? In my application, I could > potentially have hundreds of users logged into the system at one time. > What are the implications of having hundreds of threads active? It's going to really suck. Why do you want to do this? > I would probably still have a pool of threads already created, but > rather than handling individual connections, they would handle sessions > (i.e. they would be occupied and not in the pool for as long as the > user is logged into the system, not just when they're connected to the > server). Aren't they just going to be waiting around 99.9% of the time? In that case, what's their point? DS .