C# multithreaded windows service, private or [ThreadStatic] -


i'm in process of converting console application wrote single windows service windows service supports multithreading. however, first go around multithreads.

i wondering if should make every class private static instead of public static , has remain public, attach [threadstatic] attribute.

basically code lot of string work html crawling , places select data in mysql database.

the answer first question no; adapting code support multiple threads not (necessarily) mean need change member or type accessibility.

as second question, use threadstatic on fields (not types) if need each thread have own independent static field (otherwise threads share same static field).


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -