This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Q on synchronised

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
iam confused with synchronized methods. can someone give me a brief implementation for it.
i have a method
public bookSeats(....) {
lock()
reserve()
unlock()
}
which r the methods to be syncronized ? do i have to make bookseats as syncronised or all the 3 methods to be sync..
pls help.
 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Not meaning to be harsh but I think that before you ask for other people to provide you with code you should spend some time working reading around the subject and working through examples.
Try http://developer.java.sun.com and look for tutorials on threads if you haven't already.
If you are having problems with the assignment then think of how you would solve the problem and submit it to the forum for comments. People are more than happy to point out if you are are on the wrong track.
Thanks,
Steve
 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i completed my assignment. iam just working on performance issues. i want to c how others did that. i made the synchronized object lock on lock / unlock and reserve as syncronized method. i read so many articles. they say if a class implements another we should not syncronized the class method
like
syncronized() {
a()
b()
}
i was confuse with my reading. i thought someone would help . my data class is extended by 2 other classes. i dont want to assume stuffs & submit my assignment.
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic