Friday, 22 April 2016

How to share the objects safely ?


POLICIES FOR SHARING OBJECT

Thread confined object
owned exclusively by one thread and can be modified by its owning thread.

Shared Read-only object
can be accessed concurrently by multiple threads but cannot be modified by any thread.
(Immutable and Effectively immutable objects)

Shared Thread-safe object
performs synchronization internally and multiple threads can access / modify

Guarded object
can be accessed only with a specific lock held.
These are encapsulated within other thread-safe objects.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.