Patent ID: 7249355

Claim:
A method for handling multithreaded execution of network events for an application comprising: accepting a thread pool size indication from said application indicating a number of dedicated threads to maintain in a dedicated thread pool; maintaining a queue comprising one or more network work items; choosing an execution procedure, from a choice comprising two options, based on whether said thread pool size indication is zero or non-zero; and executing one or more network work items using the chosen execution procedure, wherein a first of said two options comprises: managing a thread pool comprising a number of dedicated threads, where said number is based on said thread pool size indication and allowing a network work item from said queue to execute on one of said dedicated threads, and wherein a second of said two options comprises: allowing network work items from said queue to execute only when indicated by said application that network work items may be performed, wherein said choosing chooses said first of said two options in the case where said thread pool size indication is non-zero, and wherein said choosing chooses said second of said two options in the case where said thread pool size indication is zero.