Sie sind auf Seite 1von 16

https://www.dre.vanderbilt.edu/~schmidt/POSA/POSA2/conc-patterns.

html (Concurrency
Patterns Nice)

http://www.artima.com/insidejvm/ed2/threadsynch.html (Read firsst)

http://javarevisited.blogspot.in/2011/06/volatile-keyword-java-example-
tutorial.html#at_pco=smlwn-1.0&at_si=58777c4fa17829dd&at_ab=per-2&at_pos=0&at_tot=1

http://www.uml-diagrams.org/examples/java-6-thread-state-machine-diagram-
example.html

http://www.javaworld.com/article/2074217/java-concurrency/java-101--understanding-
java-threads--part-1--introducing-threads-and-runnables.html
http://www.javaworld.com/article/2074318/java-concurrency/java-101--understanding-
java-threads--part-2--thread-synchronization.html
http://www.javaworld.com/article/2071214/java-concurrency/java-101--understanding-
java-threads--part-3--thread-scheduling-and-wait-notify.html
http://www.javaworld.com/article/2074481/java-concurrency/java-101--understanding-
java-threads--part-4---thread-groups--volatility--and-threa.html

http://www.javaworld.com/article/2078809/java-concurrency/java-concurrency-java-
101-the-next-generation-java-concurrency-without-the-pain-part-1.html
http://www.javaworld.com/article/2078848/java-concurrency/java-concurrency-java-
101-the-next-generation-java-concurrency-without-the-pain-part-2.html

https://books.google.co.in/books?
id=vNPW8Btqxk4C&pg=PA497&lpg=PA497&dq=synchronization:
+coordinating+activities+and+data+access+among+multiple+threads&source=bl&ots=fpXui
arATZ&sig=H82E4FJvAcRHY9stVjt7Dmev67Q&hl=en&sa=X&ved=0ahUKEwiS_6Tjo7nQAhUaSY8KHbuVC
uwQ6AEINTAE#v=onepage&q=synchronization%3A%20coordinating%20activities%20and%20data
%20access%20among%20multiple%20threads&f=false

http://www.nakov.com/inetjava/lectures/part-1-sockets/InetJava-1.3-
Multithreading.html

https://www.safaribooksonline.com/library/view/learning-java-
4th/9781449372477/ch09s03.html

http://javafinalize.blogspot.in/search/label/monitor (Nice for interview)

http://www.di.ase.md/~aursu/JavaThreadsSynchronization.html
synchronization among threads in Java is to serialize their access to some
resource

http://www.javaworld.com/article/2076971/java-concurrency/how-the-java-virtual-
machine-performs-thread-synchronization.html
In Java language terminology, the coordination of multiple threads that must access
shared data is called synchronization. The language provides two built-in ways to
synchronize access to data: with synchronized statements or synchronized methods.
My notes; What is that Cordination?
Executing threads one after another which is decided by JVM .That is
serializing threads to access shared objects .

Synchronizing Threads
https://www.cs.princeton.edu/courses/archive/spr96/cs333/java/tutorial/java/threads
/synchronization.html
So far, this lesson has contained examples with independent, asynchronous threads.
That is, each thread contained all of the data and methods required for its
execution and didn't require any outside resources or methods. In addition, the
threads in those examples ran at their own pace without concern over the state or
activities of any other concurrently running threads.
However, there are many interesting situations where separate concurrently running
threads do share data and must consider the state and activities of those other
threads. One such set of programming situations are known as Producer/Consumer
scenarios where the Producer generates a stream of data which then is consumed by a
Consumer.

For example, you can imagine a Java application where one thread (the producer)
writes data to a file while a second thread (the consumer) reads data from the same
file. Or, as you type characters on the keyboard, the producer thread places key
events in an event queue and the consumer thread reads the events from the same
queue. Both of these examples use concurrent threads that share a common resource:
a file, an event queue. And because the threads share a common resource, they must
be synchronized in some way

http://javafinalize.blogspot.in/search/label/monitor

https://en.wikipedia.org/wiki/Synchronization_(computer_science)

http://www.careerride.com/Java-what-is-synchronization.aspx

https://www.techopedia.com/definition/13390/synchronization-dot-net

http://www.ibm.com/developerworks/java/tutorials/j-threads/j-threads.html

http://spyhce.com/blog/design-patterns(Design patterns definition nice)

http://www.mijnadres.net/published/Monitor%20Object%20Pattern.pdf (Nice)

http://www.slideshare.net/charsyam2/monitor-object

http://www.waitingforcode.com/java-concurrency/object-monitor-pattern/read

https://www.coursehero.com/file/p7dbu45/Apply-the-Monitor-Object-pattern-to-
synchronize-the-shared-queue-efficiently/

https://sudo.ch/unizh/concurrencypatterns/ConcurrencyPatterns.pdf

http://nob.cs.ucdavis.edu/classes/ecs150-2008-02/handouts/sync/sync-problems.html

https://www.youtube.com/watch?v=_5sbBARRpws

https://www.youtube.com/watch?v=oAvDV7LSay0

https://www.youtube.com/watch?v=s8_ZxcG7Jco&list=PLbu9W4c-C0iAGUc7dQlqXIsXkGnHMaTEz

https://www.youtube.com/watch?v=_p-TM1x48zk (Section 3: Module 1: Part 1: the


Monitor Object pattern (Part 1))

What is difference between cocurrency ,thread safety,synchronization?

https://www.youtube.com/watch?v=1S5kqkLFxYk (Normalization)

http://nob.cs.ucdavis.edu/classes/ecs150-2008-02/handouts/sync/sync-problems.html

https://www.youtube.com/watch?
v=jj6PzIWXQ1M&list=PLTLvfz4k7GEtMG2Vmqgd8CXrMQ1tqw1zc&index=4
https://www.youtube.com/watch?v=_5sbBARRpws&t=293s

https://www.youtube.com/watch?v=15Q8PILXkQ0

https://www.youtube.com/watch?v=VWeyrtcFEI0

https://www.youtube.com/watch?v=6gS1TH6xTAY&list=PLgre7dUq8DGKbtnlMuJPvPYlvLdXOC9uh

https://www.youtube.com/watch?v=p0SKPpC5r9U

https://www.youtube.com/watch?v=rCiQc3ife90&t=448s

https://www.youtube.com/watch?v=Z12R-FMtods

https://www.youtube.com/watch?
v=_vfZhdTgA5A&list=PLTLvfz4k7GEtMG2Vmqgd8CXrMQ1tqw1zc&index=6

___________________________________________________________________________________
_____________________________________________________________________________

What is Concurrency?
https://www.reference.com/technology/concurrency-operating-systems-
9b9363bea4e5629c#

In computer science, concurrency is the execution of several instruction sequences


at the same time. In an operating system, this happens when there are several
process threads running in parallel. These threads may communicate with each other
through either shared memory or message passing.

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
--------------

What is Concurrent Programming?


https://www.reference.com/technology/concurrency-operating-systems-
9b9363bea4e5629c#

In concurrent programming, programmers attempt to break down a complex problem into


several simultaneous executing processes that can be addressed individually.
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
--------------

Concurrent Programming Rchitecture/DesignPattern?


https://www.dre.vanderbilt.edu/~schmidt/POSA/POSA2/conc-patterns.html

There are many patterns (https://en.wikipedia.org/wiki/Concurrency_pattern)


(http://social.technet.microsoft.com/wiki/contents/articles/13210.concurrency-
design-pattern.aspx)
that address various types of concurrency architecture and design issues for
components, subsystems, and applications 5 of them are below:

Active Object,
Monitor Object, (https://en.wikipedia.org/wiki/Monitor_(synchronization))
Half-Sync/Half-Async,
Leader/Followers,
Thread-Specific Storage.
The choice of concurrency architecture has a significant impact on the design and
performance of multi-threaded networking middleware and applications. No single
concurrency
architecture is suitable for all workload conditions and hardware and software
platforms. The patterns in this chapter therefore collectively provide solutions to
a variety of
concurrency problems.

The first two patterns described below specify designs for sharing resources among
multiple threads or processes:

The Active Object design pattern decouples method execution from method invocation.
Its purpose is to enhance concurrency and simplify synchronized access to objects
that reside in their own threads of control

The Monitor Object design pattern synchronizes concurrent method execution to


ensure that only one method at a time runs within an object. It also allows an
object's methods to schedule their execution sequences cooperatively.

-->Both above patterns can synchronize and schedule methods invoked concurrently on
objects. The main difference is that an active object executes its methods in a
different thread than its clients, whereas a monitor object executes its
methods by borrowing the thread of its clients. As a result active objects can
perform more sophisticated--albeit expensive--scheduling to determine the order in
which their methods execute.

The Half-Sync/Half-Async architectural pattern decouples asynchronous and


synchronous processing in concurrent systems, to simplify programming without
reducing performance undudly. This pattern introduces two intercommunicating
layers, one for asynchronous and one for synchronous service processing. A queuing
layer mediates communication between services in the asynchronous and synchronous
layers.

The Leader/Followers architectural pattern provides an efficient concurrency model


where multiple threads take turns to share a set of event sources to detect,
demultiplex, dispatch, and process service requests that occur on the event
sources. The Leader/Followers pattern can be used in lieu of the Half-Sync/Half-
Async and Active Object patterns to improve performance when there are no
synchronization or ordering constraints on the processing of requests by pooled
threads.

The Thread-Specific Storage design pattern allows multiple threads to use one
`logically global' access point to retrieve an object that is local to a thread,
without incurring locking overhead on each access to the object. To some extent
this pattern can be viewed as the `antithesis' of the other patterns in this
section, because it addresses several inherent complexities of concurrency by
preventing the sharing of resources among threads.

----------------------------->Java Uses Monitor Object Pattern


___________________________________________________________________________________
_____________________________________________________________________________

https://en.wikipedia.org/wiki/Synchronization_(computer_science)

Thread synchronization is defined as a mechanism which ensures that two or more


concurrent processes or threads do not simultaneously execute some particular
program segment known as critical section. Processes' access to critical section is
controlled by using synchronization techniques. When one thread starts executing
the critical section (serialized segment of the program) the other thread should
wait until the first thread finishes. If proper synchronization techniques[2] are
not applied, it may cause a race condition where the values of variables may be
unpredictable and vary depending on the timings of context switches of the
processes or threads.

For example, suppose that there are three processes namely, 1, 2 and 3. All three
of them are concurrently executing and they need to share a common resource
(critical section) as shown in Figure 1. Synchronization should be used here to
avoid any conflicts for accessing this shared resource. Hence, when Process 1 and 2
both try to access that resource it should be assigned to only one process at a
time. If it is assigned to Process 1, the other process (Process 2) needs to wait
until Process 1 frees that resource (as shown in Figure 2

Another synchronization requirement which needs to be considered is the order in


which particular processes or threads should be executed. For example, we cannot
board a plane until we buy a ticket. Similarly, we cannot check emails without
validating our credentials (i.e., user name and password). In the same way, an ATM
will not provide any service until we provide it with a correct PIN.

Other than mutual exclusion, synchronization also deals with the following:

deadlock, which occurs when many processes are waiting for a shared resource
(critical section) which is being held by some other process. In this case the
processes just keep waiting and execute no further;
starvation, which occurs when a process is waiting to enter the critical section
but other processes monopolize the critical section and the first process is forced
to wait indefinitely;
priority inversion, which occurs when a high priority process is in the critical
section, it may be interrupted by a medium priority process. This violation of
priority rules can happen under certain circumstances and may lead to serious
consequences in real-time systems;
busy waiting, which occurs when a process frequently polls to determine if it has
access to a critical section. This frequent polling robs processing time from other
processes.
Classic problems of synchronization[edit]
The following are some classic problems of synchronization:

The ProducerConsumer Problem (also called The Bounded Buffer Problem);


The ReadersWriters Problem;
The Dining Philosophers Problem.
These problems are used to test nearly every newly proposed synchronization scheme
or primitive.

http://berb.github.io/diploma-thesis/original/023_concurrency.html#syncoord

https://www.dre.vanderbilt.edu/~schmidt/cs282/PDFs/Concurrency-and-Synchronization-
parts6-and-7.pdf

http://jeremymanson.blogspot.in/2007/08/atomicity-visibility-and-ordering.html

http://sce.uhcl.edu/helm/rationalunifiedprocess/process/workflow/ana_desi/co_cncry.
htm

http://courses.cs.vt.edu/~cs5204/fall00/monitor.html
Monitors were first proposed by Brinch Hansen (1) and later refined by Hoare (2).
Monitors provide a structured concurrent programming primitive, which is used by
processes to ensure exclusive access to resources, and for synchronizing and
communicating among users. A monitor module encapsulates both a resource definition
and operations/ procedures that exclusively manipulate it. Those procedures are the
gateway to the shared resource and called by the processes to access the resource.
Only one call to a monitor procedure can be active at a time and this protects data
inside the monitor from simultaneous access by multiple users. Thus mutual
exclusion is enforced among tasks using a monitor. Processes that attempt monitor
entry while the monitor is occupied are blocked on a monitor entry queue.

To synchronize tasks within the monitor, a condition variable is used to delay


processes executing in a monitor. It may be declared only within a monitor and has
no numeric value like semaphores do. Two operations, wait and signal, are defined
on condition variables. The wait operation suspends/blocks execution of the calling
process if a certain condition is true. Then the monitor is unlocked and allows
another task to use the monitor. When the same condition becomes false, then the
signal operation resumes execution of some process suspended after a wait on that
condition, by placing it in the processor ready queue. If there are several such
processes, choose one of them; if there are no waiting processes, the signal
operator is ignored. Therefore, the introduction of condition variables allows more
than one process to be in the same monitor at the same time, although only one of
them will be actually active within that monitor.

A condition variable is associated with a queue of the processes that are currently
waiting on that condition. First-in-first-out (FIFO) discipline is generally used
with queues, but priority queues can also be implemented by specifying the priority
of the process to be delayed as a parameter in the wait operation. (Condition
variables are assumed to be fair in the sense that a process will not remain
suspended forever on a condition variable that is signaled infinitely often.)
Therefore, monitors allow flexibility in scheduling of the processes waiting in
queues.

Definition - What does Synchronization mean?

https://www.techopedia.com/definition/13390/synchronization-dot-net

Synchronization, in the context of .NET, is a process that involves coordinating


the execution of multiple threads to ensure a desired outcome without corrupting
the shared data and preventing any occurrence of deadlocks and race conditions.

Techopedia explains Synchronization

There are two types of synchronization: data synchronization and process


synchronization:

Process Synchronization: The simultaneous execution of multiple threads or


processes to reach a handshake such that they commit a certain sequence of actions.
Lock, mutex, and semaphores are examples of process synchronization.
Data Synchronization: Involves the maintenance of data to keep multiple copies of
data coherent with each other, or to maintain data integrity. For example, database
replication is used to keep multiple copies of data synchronized with database
servers that store data in different locations.
Synchronization forms the basis of the execution of multiple threads asynchronously
in a multithreaded application. It provides the means to achieve the sharing of
resources such as file handling, network connections and memory by coordinating
threads and processes to avoid data corruption.
The term is used in the context of multithreaded applications where the resources
to be shared across multiple threads have to be controlled, which otherwise can
lead to an unpredictable and undesirable outcome. The .NET framework provides
synchronization primitives using the multi-threaded applications controlled without
any race conditions.

Synchronization is designed to be cooperative, demanding that every thread follow


the synchronization mechanism before accessing protected resources for consistent
results. Locking, signaling, lightweight synchronization types, spinwait and
interlocked operations are mechanisms related to synchronization in .NET.

What is synchronization and why is it important? Describe synchronization in


respect to multithreading.
http://www.careerride.com/Java-what-is-synchronization.aspx

Synchronization is the process of allowing threads to execute one after another.

Synchronization control the access the multiple threads to a shared resources.


Without synchronization of threads, one thread can modify a shared variable while
another thread can update the same shared variable, which leads to significant
errors.

What is synchronization and why is it important?


http://www.careerride.com/Java-what-is-synchronization.aspx

Java supports multiple threads to be executed. This may cause two or more threads
to access the same fields or objects. Synchronization is a process which keeps all
concurrent threads in execution to be in synch. Synchronization avoids memory
consistence errors caused due to inconsistent view of shared memory. When a method
is declared as synchronized; the thread holds the monitor for that method's object
If another thread is executing the synchronized method, your thread is blocked
until that thread releases the monitor.

Monitor defnition in Concurrency

https://en.wikipedia.org/wiki/Monitor_(synchronization)

Monitor (synchronization) In concurrent programming, a monitor is a synchronization


construct that allows threads to have both mutual exclusion and the ability to wait
(block) for a certain condition to become true. Monitors also have a mechanism for
signalling other threads that their condition has been met.

https://www.javacodegeeks.com/2015/09/concurrency-fundamentals-deadlocks-and-
object-monitors.html

http://math.hws.edu/eck/cs124/javanotes6/c12/s1.html

http://web.mit.edu/6.005/www/fa14/classes/18-thread-
safety/#reading_18_thread_safety (Thread Safety and 4 ways of acheiving Thread
Safet in java)

http://www.vogella.com/tutorials/JavaConcurrency/article.html

http://geekexplains.blogspot.in/2008/07/threadstate-in-java-blocked-vs-waiting.html

http://www.uml-diagrams.org/examples/java-6-thread-state-machine-diagram-
example.html
http://mrbool.com/working-with-java-executor-framework-in-multithreaded-
application/27560

https://www.youtube.com/channel/UCrXzgNQ6RV3Xm8kMTvEYnBw/videos

http://www.javadiscover.blogspot.in/search/label/Threads

http://www.javatpoint.com/static-synchronization-example

http://www.javatpoint.com/inter-thread-communication-example

http://www.avajava.com/tutorials/lessons/how-do-i-use-a-synchronized-block-in-a-
static-method.html

https://www.youtube.com/watch?v=ulldMV2yB2A (Threads & SYnchronized)

https://www.youtube.com/watch?v=KapFKr1K8-U (Thread Executor FrmaeWork)

https://www.youtube.com/watch?v=t7ZeRiqDLvQ (Concurrent Collection)

http://baptiste-wicht.com/posts/2010/09/java-concurrency-part-5-monitors-locks-and-
conditions.html
http://howtodoinjava.com/2013/07/18/when-to-use-countdownlatch-java-concurrency-
example-tutorial/
http://baptiste-wicht.com/posts/2010/09/java-concurrency-part-5-monitors-locks-and-
conditions.html
http://howtodoinjava.com/2013/07/18/when-to-use-countdownlatch-java-concurrency-
example-tutorial/
http://examples.javacodegeeks.com/core-java/util/concurrent/executorservice/java-
executorservice-example-tutorial/
http://www.javacodegeeks.com/2012/08/java-concurrency-cyclicbarrier-example.html
http://www.javacodegeeks.com/2011/09/java-concurrency-tutorial-callable.html
http://www.javacodegeeks.com/2011/09/java-concurrency-tutorial-reentrant.html
http://examples.javacodegeeks.com/core-java/util/concurrent/threadfactory/java-
util-concurrent-threadfactory-example/
http://javarevisited.blogspot.in/2015/01/how-to-use-future-and-futuretask-in-
Java.html

http://technologyrants.blogspot.in/2013/03/concurrent-programming-concepts-in-
java.html (With Example Traffic Light Example)

http://jsug.at/w/images/7/71/JSUG-Slides_EffectiveJavaPuzzlers_Christoph_Pickl.pdf

http://www.slideshare.net/rinoto/concurrent-programming-in-java (Here exlains in a


single lien of what is context swiching)

http://javadecodedquestions.blogspot.in/2012/01/java-concurrency.html

https://javainterviewsquestions.wordpress.com/category/java-concurrency/

http://www.java-success.com/scenarios-java-multithreading-interview-questions/

http://www.careercup.com/page?pid=threads-interview-questions

http://crackingjavainterviews.blogspot.in/2013/04/top-interview-questions-for-
investment.html
http://crackingjavainterviews.blogspot.in/2015/02/how-would-you-count-word-
occurrence-in.html

http://crackingjavainterviews.blogspot.in/2013/04/cracking-core-java-
interviews.html

http://crackingjavainterviews.blogspot.in/2013/04/cracking-core-java-
interviews.html ( nice

http://www.cloudsopedia.com/interviewquestions/corejava/java-fundamentals-2.php

http://howtodoinjava.com/2013/07/18/when-to-use-countdownlatch-java-concurrency-
example-tutorial/

http://knowledgesun.com/core-java-multithreading-interview-questions/

http://knowledgesun.com/core-java-multithreading-interview-questions/

http://javahungry.blogspot.com/2014/04/fail-fast-iterator-vs-fail-safe-iterator-
difference-with-example-in-java.html

http://javahungry.blogspot.com/2013/10/count-total-number-of-times-each-alphabet-
appears-in-the-string.html

http://javabuddy.hubpages.com/hub/10-advanced-Java-Concurrency-Interview-question-
answers

http://javabuddy.hubpages.com/hub/What-is-PATH-and-CLASSPATH-in-Java-set-Windows-
Unix-Linux

http://javabuddy.hubpages.com/hub/How-to-sort-Vector-in-Java-Ascending-Descending-
Order-Example

http://www.slideshare.net/hirist/top-100-java-interview-questions-and-answers
(Nice)

https://www.kifi.com/antonio-vidalgarc%C3%ADa/java-concurrency

http://amit.softcaretech.in/blog/java-multithreading-interview/

http://www.javamadesoeasy.com/2015/03/thread-concurrency-top-50-interview.html

http://javarevisited.blogspot.sg/2014/06/how-to-create-custom-exception-in-
java.html

http://www.programcreek.com/2014/02/how-to-make-a-method-thread-safe-in-java/

http://blog.csdn.net/schen6/article/details/16341233

http://crunchify.com/hashmap-vs-concurrenthashmap-vs-synchronizedmap-how-a-hashmap-
can-be-synchronized-in-java/

http://www.javapandit.net/java-best-questions1.html

http://crackingjavainterviews.blogspot.in/2013/04/cracking-core-java-
interviews.html

https://books.google.co.in/books?
id=GMEtBAAAQBAJ&printsec=frontcover#v=onepage&q&f=false

http://crackingjavainterviews.blogspot.in/2013/04/cracking-core-java-
interviews.html

http://www.slideshare.net/choksheak/advanced-introduction-to-java-multi-threading-
full-chok

http://www.slideshare.net/caroljmcdonald/java-concurrency-memory-model-and-trends-
4961797

http://www.slideshare.net/rajeshanandakumar/java-multithreading-and-concurrency

https://dzone.com/refcardz/core-java-concurrency (Nice reference)

https://www.youtube.com/watch?v=YdlnEWC-7Wo&list=PLBB24CFB073F1048E (Advanve Java


Multithreading)

https://www.youtube.com/watch?v=LwLtryX1lX4 (Stack & heap)

http://www.nakov.com/inetjava/lectures/part-1-sockets/InetJava-1.3-
Multithreading.html

http://coderevisited.com/thread-pool-in-java/

http://www.dailyfreecode.com/code/thread-priority-2059.aspx

https://www.artima.com/insidejvm/ed2/threadsynchP.html

https://dzone.com/articles/java-volatile-keyword-0

http://www.javatpoint.com/join()-method

Mutual Exclusion

In computer science, mutual exclusion refers to the requirement of ensuring that no


two concurrent processes [a] are in their critical section at the same time; it is
a basic requirement in concurrency control, to prevent race conditions.

https://www.youtube.com/watch?v=FRm6zJRAOTI (Java MUTEX LOCK Example)

http://howtodoinjava.com/2015/01/06/how-to-use-locks-in-java-java-util-concurrent-
locks-lock-tutorial-and-example/

http://howtodoinjava.com/2013/03/12/java-executor-framework-tutorial-and-best-
practices/

https://docs.oracle.com/javase/specs/jls/se6/html/j3TOC.html

https://docs.oracle.com/javase/specs/jls/se6/html/memory.html

https://docs.oracle.com/javase/specs/jls/se6/html/j3TOC.html

https://docs.oracle.com/javase/specs/jls/se6/html/j3TOC.html

https://docs.oracle.com/javase/6/docs/

A monitor is an instance of a class that can be used safely by several threads. All
the methods of a monitor are executed with mutual exclusion. So at most one thread
can execute a method of the monitor at the same time.

http://stackoverflow.com/questions/3047564/java-synchronized-method-lock-on-object-
or-method

http://tutorials.techmytalk.com/2014/07/03/synchronization/

http://crunchify.com/what-is-lock-unlock-reentrantlock-trylock-and-how-its-
different-from-synchronized-block-in-java/

http://javarevisited.blogspot.in/2013/03/reentrantlock-example-in-java-
synchronized-difference-vs-lock.html

https://www.youtube.com/watch?v=3hg6-OQUNY0 (Nice)

http://baptiste-wicht.com/posts/2010/09/java-concurrency-part-5-monitors-locks-and-
conditions.html

http://baptiste-wicht.com/categories/concurrency.html

http://baptiste-wicht.com/posts/2010/09/java-synchronization-mutual-exclusion-
benchmark.html

http://www.montefiore.ulg.ac.be/~pw/cours/psfiles/struct-cours7-e.pdf

http://www.coderanch.com/t/516096/threads/java/monitor-Java-multi-thread-
programming

http://www.artima.com/insidejvm/ed2/threadsynch.html

http://www.coderanch.com/t/497902/threads/java/Java-Thread-object-monitor-fit

http://baptiste-wicht.com/posts/2010/09/java-concurrency-part-5-monitors-locks-and-
conditions.html

http://howtodoinjava.com/2013/03/12/java-executor-framework-tutorial-and-best-
practices/

http://howtodoinjava.com/2015/01/06/how-to-use-locks-in-java-java-util-concurrent-
locks-lock-tutorial-and-example/

http://howtodoinjava.com/2013/03/08/thread-synchronization-object-level-locking-
and-class-level-locking/

http://javarevisited.blogspot.in/2014/10/how-to-use-locks-in-multi-threaded-java-
program-example.html

http://javarevisited.blogspot.in/2014/10/how-to-use-locks-in-multi-threaded-java-
program-example.html (Using locks)

http://javarevisited.blogspot.sg/2013/12/inter-thread-communication-in-java-wait-
notify-example.html

http://stackoverflow.com/questions/5861894/how-to-synchronize-or-lock-upon-
variables-in-java

http://www.javaworld.com/article/2078848/java-concurrency/java-concurrency-java-
101-the-next-generation-java-concurrency-without-the-pain-part-2.html
https://www.youtube.com/playlist?list=PLZ9NgFYEMxp4KSJPUyaQCj7x--NQ6kvcX

https://www.youtube.com/watch?v=YdlnEWC-7Wo&list=PLBB24CFB073F1048E

http://javarevisited.blogspot.in/2011/04/synchronization-in-java-synchronized.html
(Nice overview)

http://stackoverflow.com/questions/3047564/java-synchronized-method-lock-on-object-
or-method (Nice diffeence between static block and static method)

phareddy@in.ibm.com - Phani

http://tutorials.techmytalk.com/2014/07/03/synchronization/

phareddy@in.ibm.com - Phani

http://whaticode.com/2012/05/21/lock-mechanisms-in-java/

http://www.javaexperience.com/what-is-singleton-pattern-and-how-to-make-it-
threadsafe/

http://www.javaexperience.com/page/5/?s=Threads

http://www.quora.com/What-do-we-mean-by-saying-a-class-level-lock-is-a-taken-by-a-
thread-on-the-java-lang-Class-instance-associated-with-a-Java-class ( nice)

http://programmers.stackexchange.com/questions/206732/how-to-make-a-method-
synchronized-across-all-instances-of-an-object

http://crackingjavainterviews.blogspot.in/2013/04/cracking-core-java-
interviews.html

http://www.journaldev.com/1061/java-synchronization-and-thread-safety-tutorial-
with-examples

http://www.journaldev.com/1050/java-timer-and-timertask-example-tutorial

http://www.journaldev.com/1079/java-thread-tutorial

http://www.javamex.com/tutorials/wait_notify_how_to.shtml

https://www.youtube.com/watch?v=q-DuzRHWCj4

https://www.youtube.com/watch?v=dk3Iiqof6jA

https://www.youtube.com/watch?v=fITuhLSwbt8

https://www.youtube.com/watch?v=Zfmk0GtANNs

https://www.youtube.com/user/MargretPosch/videos (nice)

https://www.youtube.com/watch?v=IBPGUSrW1Po

https://www.youtube.com/watch?v=zwocnEB9_1I&list=PL-8TVnCXtjy_xg_3qr4j5tn5qRrI-1wBQ

https://www.youtube.com/user/MargretPosch/videos
http://www.programcreek.com/2011/12/monitors-java-synchronization-mechanism/

http://www.programcreek.com/2011/12/monitors-java-synchronization-mechanism/
(monitor and semaohore

https://en.wikipedia.org/wiki/Monitor_(synchronization)

http://www.csc.villanova.edu/~mdamian/threads/javamonitors.html

http://www.javacreed.com/understanding-threads-monitors-and-locks/

http://tutorials.jenkov.com/java-concurrency/java-memory-model.html (Very NIce java


memory and jav threads relation)

http://www.cmi.ac.in/~madhavan/courses/pl2009/lecturenotes/lecture-
notes/node64.html

http://www.uml-diagrams.org/examples/java-6-thread-state-machine-diagram-
example.html

https://mishrabagish.wordpress.com/2012/12/17/explicit-vs-intrinsic-locks-in-java-
ensuring-thread-scheduling-fairness/

http://blog.takipi.com/5-things-you-didnt-know-about-synchronization-in-java-and-
scala/

http://www.javamadesoeasy.com/2015/03/acquiring-lock-on-class-2-ways-to.html

http://www.javamadesoeasy.com/2015/03/difference-between-object-lock-and.html

http://www.javamadesoeasy.com/p/data-structures.html

http://howtodoinjava.com/2013/03/08/thread-synchronization-object-level-locking-
and-class-level-locking/

http://www.nyu.edu/classes/jcf/g22.3033-007_sp01/handouts/g22_3033_h53.htm

https://books.google.co.in/books?
id=O6fJBAAAQBAJ&pg=PA97&lpg=PA97&dq=every+java+object+has+a+monitor+means+what&sour
ce=bl&ots=YhjHg2NIdE&sig=3lSFyV2WGcPu14F_U7EHeuh336c&hl=en&sa=X&ved=0CFAQ6AEwCGoVCh
MI4v-KkJv-xgIVA-KmCh1z_Q1K#v=onepage&q=every%20java%20object%20has%20a%20monitor
%20means%20what&f=false

https://www.artima.com/insidejvm/ed2/threadsynch.html

http://www.javaworld.com/article/2074318/java-concurrency/java-101--understanding-
java-threads--part-2--thread-synchronization.html

https://books.google.co.in/books?id=2pKCnc6-
UAEC&pg=PA44&lpg=PA44&dq=Each+object+in+Java+is+associated+with+a+monitor+means+wha
t&source=bl&ots=BTgnlxnVIR&sig=dviFL4oNclQ1MyRHey0IqN7s5Jw&hl=en&sa=X&ved=0CDoQ6AEw
BjgeahUKEwjT68D8nf7GAhXCLKYKHSTKC98#v=onepage&q=Each%20object%20in%20Java%20is
%20associated%20with%20a%20monitor%20means%20what&f=false

see the above book page no 42 section 3.3 for condition syncrnization that is
wiat/notify alll

http://www.jchq.net/certkey/index.htm
https://www.bionicspirit.com/blog/2013/03/14/jvm-multithreading-monitor-locks-
visibility.html

http://stackoverflow.com/questions/3362303/whats-a-monitor

https://en.wikipedia.org/wiki/Monitor_%28synchronization%29

http://docs.oracle.com/javase/specs/jls/se6/jls3.pdf

http://lass.cs.umass.edu/~shenoy/courses/fall10/lectures/Lec09_notes.pdf

http://www.programcreek.com/2011/12/monitors-java-synchronization-mechanism/

http://cs.nyu.edu/~lerner/spring12/Preso03-JavaPrimitives.pdf

http://simone-folino.blogspot.in/2012/05/implicit-lock-object-lock-and-class.html

http://www.dineshonjava.com/2013/05/static-synchronization-non-
static.html#.Vbe0D_mqqko

http://winterbe.com/posts/2015/04/30/java8-concurrency-tutorial-synchronized-locks-
examples/

https://www.artima.com/insidejvm/ed2/threadsynch.html

monitor in java threads = mutual exclusion + condition variables


INtercommunication b/w threasds is achieved by java monitors
mutual exclusion menas locks
condition variables menas conditional sycronization
which is achieved by wait/notyy

https://books.google.co.in/books?
id=rCf0yySWJKUC&pg=PA210&lpg=PA210&dq=what+does+monitor+in+java+thread+means&source
=bl&ots=I_JEJivUm_&sig=lerHzh3d5LFu-
EbMKG9940b8C8Q&hl=en&sa=X&ved=0CEMQ6AEwBjgeahUKEwisxqHQ8f_GAhWJz4AKHfNVBoQ#v=onepag
e&q=what%20does%20monitor%20in%20java%20thread%20means&f=false

http://javarevisited.blogspot.in/2011/06/volatile-keyword-java-example-
tutorial.html

http://www.programmerinterview.com/index.php/operating-systems/example-of-
threading-and-synchronization-2/

http://www.programmerinterview.com/index.php/operating-systems/monitors-vs-
semaphores/

http://www.somanyword.com/2014/06/what-is-reentrant-synchronization-or-locking-in-
java/

http://www.careerride.com/Java-what-is-synchronization.aspx

https://books.google.co.in/books?
id=JPbJLQTs1IYC&pg=PA256&lpg=PA256&dq=monitor+and+synchronized+keyword+in+java+thre
ad&source=bl&ots=Nv6bPkoLBz&sig=im0aKN35MctXqQLgMoyklkexlbY&hl=en&sa=X&ved=0CEYQ6AE
wBzgUahUKEwiNnMLFzIDHAhVYkI4KHXkuCUo#v=onepage&q=monitor%20and%20synchronized
%20keyword%20in%20java%20thread&f=false

https://books.google.co.in/books?
id=JPbJLQTs1IYC&pg=PA256&lpg=PA256&dq=monitor+and+synchronized+keyword+in+java+thre
ad&source=bl&ots=Nv6bPkoLBz&sig=im0aKN35MctXqQLgMoyklkexlbY&hl=en&sa=X&ved=0CEYQ6AE
wBzgUahUKEwiNnMLFzIDHAhVYkI4KHXkuCUo#v=onepage&q=monitor%20and%20synchronized
%20keyword%20in%20java%20thread&f=false

https://en.wikipedia.org/wiki/Monitor_(synchronization)

https://mishrabagish.wordpress.com/2012/12/17/explicit-vs-intrinsic-locks-in-java-
ensuring-thread-scheduling-fairness/ (Abou types of locks in java theads)

means intirnsic extrinsic locks

https://mishrabagish.wordpress.com/category/spring/

http://toodey.com/2015/07/30/what-is-combiner-in-mapreduce-combiner-in-depth-
mapreduce-framework/

http://www.javaworld.com/article/2076949/learn-java/how-the-java-virtual-machine-
handles-method-invocation-and-return.html?page=2

(Above link for overloading and overriding)

https://plumbr.eu/blog/locked-threads/classloading-and-locking

A monitor can be any java object in context of intercommnication b/w threads

When ever JVM encouter snchronized JVM creates a lock and it should handover that
lock to a JAvaObject.This java object has lock.Every thread has to obtain a lock to
enter a syncronzed method from that object.That object is called monitor in context
of inercomunication b/w threads

So a Monitor is any java object which JVM requires to handover the lock

THat monitor has ability to hold threads and also give notification to other thread

https://www.artima.com/insidejvm/ed2/threadsynch.html

https://books.google.co.in/books?
id=uoXYzogG1pEC&pg=PA203&lpg=PA203&dq=java+threads+monitors+explained&source=bl&ots
=xhxyZhYBiC&sig=V93It7FpPjGJbhYbxAbjaltqSFs&hl=en&sa=X&ved=0CEgQ6AEwCDhaahUKEwjyu7S
7wYXHAhWGJaYKHZIvAgE#v=onepage&q=java%20threads%20monitors%20explained&f=false

http://www.cs.princeton.edu/courses/archive/fall09/cos318/lectures/SemaphoresMonito
rs.pdf

http://www.cs.utexas.edu/users/witchel/372/lectures/08.Semaphore-Monitors.pdf

http://lass.cs.umass.edu/~shenoy/courses/fall08/lectures/Lec10.pdf

https://doc.qt.io/archives/qq/qq21-monitors.html

http://www.studytonight.com/java/joining-a-thread.php (Difference between isAlive


and join)

http://inheritingjava.blogspot.in/p/multithreading-advanced-concepts.html

http://www.javatbrains.com/2014/07/threads.html
http://www.javaworld.com/article/2071214/java-concurrency/java-101--understanding-
java-threads--part-3--thread-scheduling-and-wait-notify.html
12:31:08 PM
http://www.javaworld.com/article/2078679/java-concurrency/java-concurrency-modern-
threading-for-not-quite-beginners.html?page=2

Mutual Exclusion means once a thread acquires lock,other threads have to wait until
owner of lock releases lock.

Mutual Exclusion means avoid other thread to use a shared resource until other
thread finished using that shared resource
So mutual exclusion means while one thread is executing set of instruction which
are shared to othr threads,other thred have to wait until executing threa finishs
executing set of instructions

http://tutorials.jenkov.com/java-concurrency/java-memory-model.html

http://www.slideshare.net/michalwarecki/java-memory-model-23207253

http://jeremymanson.blogspot.in/2008/11/what-volatile-means-in-java.html#

Das könnte Ihnen auch gefallen