Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Synchronized

 
anita dhar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am not getting the concept of synchronization ,
What is the need to go for the synchronized , and any example
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Sun Concurrency Tutorial is a great place to start. There is a section on synchronization. See if that clears things up or raises more questions. Tell us what you find out!
 
Animesh Saxena
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In plain simple terms it means....preventing multiple access to it @ the same instant.

Imagine access to a ticket counter or any shared resource where you lock the counter, get the ticket, unlock it allowing access for another person.
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think of it this way:
Two Blind Cooks

### posted Yesterday 9:38 AM by Bob Ruth, in "A question from Java Concurrency in Practice." ###

This has got to be one for the books. Normally, the metaphor in computer science is The Blind Watchmaker , but think of it as though one had two computers working in parallel, to work on parts of the same task to obtain results faster.

How would you go about keeping things where they are suposed to be ?

This is the subject of � Synchronized.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!