diff --git a/Docs/SmartThreadPool.html b/Docs/SmartThreadPool.html
index dddd506..91bcbcd 100644
--- a/Docs/SmartThreadPool.html
+++ b/Docs/SmartThreadPool.html
@@ -48,6 +48,14 @@
@@ -109,6 +117,15 @@ + ++ New features added in August 2012
++
+- Enabled to set threads IsBackground.
+- Enabled to set threads ApartmentState.
+- Added support fore Windows Phone (limited).
+What about the .NET ThreadPool?
The Windows system provides one .NET ThreadPool for each process. The .NET ThreadPool can contain up to 25 (by default) threads per processor. It is also stated that the operations in .NET ThreadPool should be quick to avoid suspension of the work of others who use the .NET ThreadPool. Note that several AppDomains in the same process share the same .NET ThreadPool. If you want a thread to work for a long period of time, then the .NET ThreadPool is not a good choice for you (unless you know what you are doing). Note that each asynchronous method call from the .NET Framework that begins with "Begin…" (e.g.,
automatically if it didn't complete. The cancel works the same as a call to Cancel with theBeginInvoke,BeginSend,BeginReceive, etc.) uses the .NET ThreadPool to run its callback. Also note that the .NET ThreadPool doesn't support calls to COM with single threaded apartment (STA), since the ThreadPool @@ -764,8 +781,24 @@ to simplfy the initiation of a parallel task.abortExecutionargument set to false (This is why the timeout is passive).To sample the cancel use
-See timeout example below +See timeout example below +SmartThreadPool.IsWorkItemCanceledwhich is a static property, or you can useSmartThreadPool.AbortOnWorkItemCancelwhich check if the current work item is cancelled and if so abort the thread (Thread.CurrentThread.Abort()).Enabled to set threads IsBackground +This featue enables to set the
+IsBackgroundof the STP threads. The default istrue.To use it:
+
+STPStartInfo stpStartInfo = new STPStartInfo();
+ stpStartInfo.AreThreadsBackground = false;Enabled to set threads ApartmentState +This featue enables to set the
+ApartmentStateof the STP threads. The default is not to set.To use it:
+
+STPStartInfo stpStartInfo = new STPStartInfo();+
+ stpStartInfo.ApartmentState = ApartmentState.MTA;Support Windows Phone (limited) +Add reference to SmartThreadPoolWP.dll in your code and use it.
++ +
When to use?
The Smart Thread Pool is good when your work items don't do too much, but wait for events, IOs, sockets, etc. This means that the work items don't use CPU, but run for a long time. It is also good when you don't need to keep alive too many threads in the air all the time. If your work items do a short time work, then use the .NET ThreadPool. If you have a constant heavy load of work, then use Toub's thread pool and define the maximum number of threads accordingly.
@@ -1405,16 +1438,27 @@ public class TimeoutExample7th April 2009: Changes -
- Added support for Silverlight and Mono.
-- Added Join, Choice, and Pipe to SmartThreadPool.
-- Added local performance counters (for Mono, Silverlight, and WindowsCE)
-- Changed duration measures from DateTime.Now to Stopwatch.
-- Queues changed from System.Collections.Queue to System.Collections.Generic.LinkedList<T>.
+- Added support for Silverlight and Mono.
+- Added Join, Choice, and Pipe to SmartThreadPool.
+- Added local performance counters (for Mono, Silverlight, and WindowsCE)
+- Changed duration measures from DateTime.Now to Stopwatch.
+- Queues changed from System.Collections.Queue to System.Collections.Generic.LinkedList<T>.
21st December 2009: Changes +-
+- Added work item timeout (passive).
+- Added work item timeout (passive).
+20 August 2012: Changes + diff --git a/Docs/WindowsPhone.png b/Docs/WindowsPhone.png new file mode 100644 index 0000000..203c571 Binary files /dev/null and b/Docs/WindowsPhone.png differ+
- Added set name to threads
+- Fixed the WorkItemsQueue.Dequeue.
+
+ Replacedwhile(!Monitor.TryEnter(this));withlock(this) { ... }- Fixed SmartThreadPool.Pipe
+- Added IsBackground option to threads
+- Added ApartmentState to threads
+- Fixed thread creation when queuing many work items at the same time.