In the first version of the Async Core, threads in the TaskPool would spin (continually become the leader and relinquish leadership even though there was no items in the request queue) this would be ok for general server applications however in the case of DISCUS the taskpool threads will be spinning in the IIS process while doing no useful work.

Author rg2023 <rg2023>
Author date 2003-01-30 18:47:00
Author local date 2003-01-30 18:47:00 +0000
Committer rg2023 <rg2023>
Committer date 2003-01-30 18:47:00
Committer local date 2003-01-30 18:47:00 +0000
Commit 6b729302c2067b962117551e3adb19db23065c87
Tree 85b433fb880416d39f095f37a5a19c561287b132
Parent 42d4afeb146bcf770499d380fa5ebeee3bab3bad
In the first version of the Async Core, threads in the TaskPool would spin (continually become the leader and relinquish leadership even though there was no items in the request queue) this would be ok for general server applications however in the case of DISCUS the taskpool threads will be spinning in the IIS process while doing no useful work.
1) Added threadsafe signal object implementations (Auto & Manual ResetSignalObject) these are used to indicate when there are requests sitting in the queue. These objects are referenced by all threads in the TaskPool
2) Modified TPTask constructor to take a reference to a signal object
3) Made the request queue static and private and provided a synchronized access method that will signal any waiting threads that a request has arrived.
Affected files:
csharpsrc/AsyncCore/AsyncCore.csproj
csharpsrc/AsyncCore/AsyncCore.suo
csharpsrc/AsyncCore/AutoResetSignalObject.cs
csharpsrc/AsyncCore/ISignalObject.cs
csharpsrc/AsyncCore/ManualResetSignalObject.cs
csharpsrc/AsyncCore/TPTask.cs
csharpsrc/AsyncCore/TaskPool.cs
csharpsrc/AsyncCore/ThreadsafeSignalObject.cs