This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Synchronizing Main THread Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Synchronizing Main THread Problem" Watch "Synchronizing Main THread Problem" New topic
Author

Synchronizing Main THread Problem

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634



1. would a thread able to start before thread main ?

i think ,main thread would start first as it own lock (a).
but, b thread can start before main thread can completes as main doesn't owns lock (b)


OCPJP 6.0 93%
OCPJWCD 5.0 98%
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

First of all, did you compile the code? What do you exactly want achieve?


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Synchronizing Main THread Problem
 
Similar Threads
synchronization and locks
notifyAll()
Deadlock
Static Lock and Instance Lock
Thread question