My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How Multi-Threading Works

Default profile photo
Anonymous
·Dec 17, 2017

I am new to Java and learning threads. Recently I came across synchronized keyword and its use. How ever i can not find answers to my one doubt-

  • If there are lets say 10 threads and i am using synchronized as well as wait() and notify() to run one thread at a time. How can I call a particular thread at a time after first thread uses notify()?

Like if there is a thread X which notify() all the other threads. Now how can I specifically ask Y thread to use that lock in place of Z thread?