|
|
|
|
|
by outworlder
2929 days ago
|
|
> which is when locking becomes essential, most languages and platforms have easy to use constructs to help you do this without much in the way of drama. This is actually a problem. It is very easy to just slap locks around which, depending on your workload, can cause the threads to be blocked waiting for work. I have seen many designs that used threads "for performance", but had so many locks in place that a single threads would actually perform similarly, with much less code complexity. Once you get past a couple of locks in your code, it starts to smell. Just because you can do Thread.New in your favorite language, doesn't mean you are using them correctly or efficiently. |
|