Archive for November 28th, 2010
And what about unmanaged thread pool For threading I will use pthreads lib(to make compatible code with all platforms that support POSIX standarts). First of all template synchronized queue( %) ): Same as C# implementation. And a simple ThreadPool : All simple but:friend void* ThreadFunc(void*); break all OOP no way to execute class function [ READ MORE ]
In this post I try to implement fully managed Thread Pool. In previous post I implement Synchronized queue. Here I use this class with some modifications. All changes here: public T Dequeue() { _threadPool.SetThreadSleepState(Thread.CurrentThread,true); _semaphore.WaitOne(); lock (_tagRootSync) _threadPool.SetThreadSleepState(Thread.CurrentThread, false); …. For removing threads from pool we should know, that our thread sleep on our semaphore [ READ MORE ]
Get every new post delivered to your Inbox.