Results 1 to 2 of 2
Thread: Thread question
- 12-16-2009, 09:10 AM #1
Member
- Join Date
- Dec 2009
- Posts
- 2
- Rep Power
- 0
Thread question
If someone could answer/explain this i'd greatly appreciate it.
class MyClass{
public synchronized void func1( ){
……
}
public synchronized void func2( ){
……
}
}
MyClass myObj=new MyClass( ); // shared by both thread
Thread 1
……
myObj.func1( );
…… Thread 2
……
myObj.func2( );
……
Do you think Thread 1 and Thread 2 can run myObj.func1() and myObj.func2() during the same time? Why or why not? Explain in detail.
- 12-16-2009, 09:27 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Similar Threads
-
Thread.sleep() and join() question
By sandeepsai39 in forum New To JavaReplies: 5Last Post: 04-20-2009, 06:51 AM -
an old question about Thread.Sleep()
By narbeh in forum Threads and SynchronizationReplies: 1Last Post: 03-25-2009, 07:12 AM -
Thread question
By Moncleared in forum Advanced JavaReplies: 5Last Post: 02-09-2009, 10:33 PM -
Thread.sleep() question
By Lachezar in forum New To JavaReplies: 5Last Post: 02-03-2009, 10:27 PM -
main thread question?
By frejon26 in forum New To JavaReplies: 1Last Post: 01-24-2008, 10:13 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks