Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Query:lock by virtual object!

Reply
Thread Tools

Query:lock by virtual object!

 
 
Jack Dowson
Guest
Posts: n/a
 
      05-04-2007
Hello Everybody:
I saw a demo as follow shows how to use virtual object to lock key
resources in order to maintain synchronizing if there are several threads.

class ClassName implements Runnable{
String str = " ";
public void run(){
...
synchronized(str){...}
}
}

I just can't understand how it works?

Any help will be greatly appreciated!

Dowson!
 
Reply With Quote
 
 
 
 
Jack Dowson
Guest
Posts: n/a
 
      05-04-2007
Jack Dowson д:
> Hello Everybody:
> I saw a demo as follow shows how to use virtual object to lock key
> resources in order to maintain synchronizing if there are several threads.
>
> class ClassName implements Runnable{
> String str = " ";
> public void run(){
> ...
> synchronized(str){...}
> }
> }
>
> I just can't understand how it works?
>
> Any help will be greatly appreciated!
>
> Dowson!

This question is really stupid!

Dowson!
 
Reply With Quote
 
 
 
 
Z.
Guest
Posts: n/a
 
      05-04-2007
Jack Dowson wrote:
> Hello Everybody:
> I saw a demo as follow shows how to use virtual object to lock key
> resources in order to maintain synchronizing if there are several threads.
>
> class ClassName implements Runnable{
> String str = " ";
> public void run(){
> ...
> synchronized(str){...}
> }
> }
>
> I just can't understand how it works?
>
> Any help will be greatly appreciated!
>
> Dowson!


http://java.sun.com/docs/books/tutor...ncy/index.html,
also:
http://java.sun.com/docs/books/tutor.../syncmeth.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
V1.1 Virtual Folder when V2.0 installed for the virtual server? Jj ASP .Net 2 11-30-2005 05:44 PM
virtual template and virtual access for ADSL circuits Gary Cisco 1 04-28-2005 07:26 PM
Virtual Computer Corporation (VCC) Virtual Workbench VW300 Derek Simmons VHDL 0 08-01-2004 04:55 AM
Deploying Servlets in virtual host / virtual filesystem environment while_1 Java 2 06-25-2004 06:00 PM
New Virtual Photo Webring - Register Your Virtual Tour Website! Chuck Arthurs Digital Photography 0 01-26-2004 02:18 PM



Advertisments