Rank: Newbie Groups: Member
Joined: 4/25/2008 Posts: 5 Points: 10
|
Is it means that we don't need to write our own thread pool after using code in the OnConnect() event ?
Is it means all we need to do is adding code to OnConnect() , and it will run in a new thread ?
sorry this question is too primitive, but i don't clearly understand it
|
Rank: Administration Groups: Administration
Joined: 2/15/2008 Posts: 130 Points: 835
|
Yes, you are absolutelly right. Thread pool is implemented by XF.Server, so you should not write your own one. Best performance results can be achived if your operation handling code is non-blocking, thus processing thread is not blocked and can be reused for other operations.
Context switching is a bottleneck for many applications, so XF.Server tries to keep the number of running threads equal to the numbers of processors(cores) in the system.
|