Click here to Skip to main content
15,888,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Are there any other wrapper or SDK for C# other than thread include in .NET framework?
Posted
Updated 22-Jan-11 21:34pm
v2
Comments
Richard MacCutchan 23-Jan-11 3:45am    
Why, what is wrong with the built in support?
Panchaz 24-Jan-11 9:29am    
i need my algorithms to run on one specific core which i can to specify.
Panchaz 19-Mar-11 2:34am    
can i specify a core to run my separate algorithms?

If you think directly using the Thread class does not suite you, take a look at the BackgroundWorker class.

And theoretically, while you can write your own framework that P/Invokes or otherwise interops with the native thread APIs, I am not sure it will automatically work as you expect with managed code. Because .NET seems to do quite some extra plumbing work when it creates its "managed" threads.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 23-Jan-11 21:27pm    
Nishant, I agree with you (and voted "5").
At the same time, please look at my answer. I offer very useful idea of my stile thread encapsulation using a wrapper. Please also see my miniature Tip/Tricks work I reference in my Answer -- I think it's interesting for many threading applications.

Thank you.
--SA
Wrapping around a thread is actually very useful. At the same time, an attempt to make a universal solution for all thinkable thread application not very useful, otherwise thread class itself could be improved, or a special language constructs would be advised.

At the same time, wrapping around thread at the level of application is very convenient.

I can illustrate this idea in my small article from Tips/Tricks section:
Simple Blocking Queue for Thread Communication and Inter-thread Invocation[^].

Please look at the usage sample and pay attention how threads are wrapped in the classes QueuedThread and DelegateInvocationThread. First of all, the method to be run in a thread is encapsulated and hidden from the class used (private), so no one can call it in a wrong threads; thread initialization is conveniently hidden; also encapsulated a method for thread control and communication, so nobody can abuse the thread via direct access to it.
 
Share this answer
 
Comments
Espen Harlinn 6-Feb-11 15:00pm    
Good effort, my 5
Sergey Alexandrovich Kryukov 6-Feb-11 18:49pm    
Thank you, I knew you would understand me.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900