About the SmartThreadPool , in the self-host. Till now, I use the AppHostHttpListenerBase. Often, I create a thread in the AppDomain to handle global background tasks . If I use the Pool hosts, can I add my thread in the SmartThreadPool also ? is it public ?
Also. is there special exceptions to log SmartThreadPool problems ?
Scott McArthur:
More information about the SmartThreadPool here: http://smartthreadpool.codeplex.com
Stefan Tsalapatis:
+Scott McArthur
thx, As I have read SmartThreadPool is instantiable, not static. Using the AppHostHttpListenerSmartPoolBase, can we have acess in the SS pool instance, to add our threads ?
it’s private atm, but yeah I guess I could make it public. Are you creating your own threads within a web request?
Stefan Tsalapatis:
+Demis Bellot
No, usually in the same level where I initialize appHost, long run. Services access global dictionaries e.g Users stats
ok cool, but in that case long running threads wont benefit from a ThreadPool.
Stefan Tsalapatis:
+Demis Bellot
right. Only I don’t know how the overall program performance will be influenced having different pool manager, or different SmartThreadPool instance.
I can’t imagine any difference if they’re never being released back into the pool, in which case using any ThreadPool is just overhead over spawning a new thread yourself. Anyway, I’ll make it public either way.
Stefan Tsalapatis:
+Demis Bellot
thx, probably you are right. there are issues that I don’t know. e.g what If I start async operations from the thread. what is the role of threadPool in this case. http://stackoverflow.com/a/17410405
Stefan Tsalapatis:
+Demis Bellot
Finally, because of async - await operations, in general, I inclined not using SmartThreadPool at all.
Because, async use the Thread.Pool internally and I am afraid to have two different pools. I am not sure about.
here a question
"async/await with other threads/pools"
http://social.msdn.microsoft.com/Forums/en-US/2be7c4e5-9f36-4d42-8f9b-e772473b1145/asyncawait-with-other-threadspools
here
http://stackoverflow.com/questions/18144040/asynchronous-callback-is-running-in-which-thread-when-i-use-smartthreadpool
and here
http://www.codeproject.com/Articles/7933/Smart-Thread-Pool?msg=4356629#xx4356629xx
yeah it sounds like using tasks would be better.