wood burning stoves 2.0*
The moose likes Threads and Synchronization and the fly likes single threaded  or multi threaded Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "single threaded  or multi threaded" Watch "single threaded  or multi threaded" New topic
Author

single threaded or multi threaded

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
How can I know an application(JEE or Stanalone or any java application) is single threaded or multi threaded?.How a multithreaded application behaves? ,How singlethreaded application behaves?.All JEE application are multithreaded?,all stanalone applcation are single threaded?
Please excuse if this question is silly,
[ September 26, 2008: Message edited by: jacob deiter ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


How can I know an application(JEE or Stanalone or any java application) is single threaded or multi threaded?.

If you wrote it you'll know . JEE application may be multithreaded - indeed its very likely to be, or what's the point.


How a multithreaded application behaves?

It does things concurrently.


,How singlethreaded application behaves?.

It does things sequentially.


All JEE application are multithreaded?,

Not necessarilly. You could write a JEE app so it is effectively sequential, but why bother?


all stanalone applcation are single threaded?

No.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41603
    
  55
As an aside, even if the the code of an application is not explicitly multi-threaded, the JVM has always a number of threads active. For example, garbage collection runs as a background thread.


Ping & DNS - my free Android networking tools app
jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
It does things concurrently

for an example,I deployed a simple POJO that retrieve value from database,layers are service layer(POJO),DAO Layer. if many user access the POJO at the same time then what will happen Subsequently,How the server serve the many users?.If the server do mutithreading means the entire things (service layer-pojo and DAO) is threaded ?
[ September 28, 2008: Message edited by: jacob deiter ]
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Originally posted by jacob deiter:

for an example,I deployed a simple POJO that retrieve value from database(service layer-POJO,DAO). if many user access the POJO at the same time then what will happen Subsequently,How the server serve the many users?.If the server do mutithreading means the entire things (service layer-pojo and DAO) is threaded ?


What is the context you are talking about? A client application you wrote? A JEE application?


Steve
jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
JEE application
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

Originally posted by jacob deiter:
JEE application


Typically the JEE application will be multi-threaded. That means you should make sure your POJO and DAO (and all your other code) are thread-safe or accessed in a thread-safe manner.
 
 
subject: single threaded or multi threaded