dcsimg
java thread and snychronization
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Sunday, April 2, 2006 12:27 PM

HI,



I am a beginner in java thread...some synchronization problems confusing me...


Is it necessary for us to create a thread for each program? or single thread can be call by many programs?


when thread call method to access to database, can we use a single thread with a method to access to many different databases? if yes, how can it snychronize it?


please help...


thank you...

regards,

bk

Re: java thread and snychronization

Posted By:   Anonymous  
Posted On:   Wednesday, April 5, 2006 05:03 PM

Is it necessary for us to create a thread for each program?

No, its not necessary unless you do not want your program/application to be synchronized.
one thread at a time is used by one resource this is called synchronization.

i think you are confused. try to understand interthread communication of multithreading

Re: java thread and snychronization

Posted By:   Almagest_FUTT  
Posted On:   Monday, April 3, 2006 07:21 AM

It's all a point of how many things have to get done at the same time. If you have only one thread, then but one things gets done at a time, and there's no need for synchronization.

I'm more than certain a visit to the google page and some adequate keywords would yield many-a tutorial you need, but in the meantime, here's one:
http://java.sun.com/docs/books/tutorial/essential/threads/index.html
About | Sitemap | Contact