Minor threading update
I made some very minor updates to the threading guidelines...
Please let me know if there are questions or comments.
Do not lock on any public types or other instances you do
not control. Notice the common construct:
lock (this)
violates this guideline if this is
publicly accessible.
Do be aware that lock() is not cheap
Perhaps your caller should do the
locking?
Granularity trade-off – concurrency vs. cost
Consider
Interlocked.Exchange, R.W.Lock
Do use the ThreadPool for best
performance
Do strive to not create architectures that expose threading
issues to the user For example, ASP.NET has great scaling, but users never deal
with threading