Concurrency in C# Cookbook by Stephen Cleary

Concurrency in C# Cookbook by Stephen Cleary

Author:Stephen Cleary
Language: eng
Format: mobi, epub, pdf
ISBN: 9781449367565
Publisher: O’Reilly Media, Inc.
Published: 2014-03-31T16:00:00+00:00


Discussion

This recipe introduced the two simplest immutable collections, the stack and the queue. However, we covered several important design philosophies that are true for all immutable collections:

An instance of an immutable collection never changes.

Since it never changes, it is naturally threadsafe.

When you call a modifying method on an immutable collection, the modified collection is returned.

Immutable collections are ideal for sharing state. However, they don’t work as well as communication conduits. In particular, don’t use an immutable queue to communicate between threads; producer/consumer queues work much better for that.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.