This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Thread and Web Applications Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Thread and Web Applications" Watch "Thread and Web Applications" New topic
Author

Thread and Web Applications

Rudra Narayan Garnaik
Ranch Hand

Joined: May 05, 2006
Posts: 39
Hi All,

Please share your points whether it is good to use thread on web applications?

- If NO/YES, then why so?


Many thanks in advance.


Regards, Rudra Narayan
www.garnaik.com
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

You shouldn't use Threads in any application. You should prefer Executor and ExecutorService instead. They decouple the threading details away.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Rudra Narayan Garnaik
Ranch Hand

Joined: May 05, 2006
Posts: 39
Thanks for your reply.

Executor and ExecutorService
: I will check it. Is it not using Thread?

Nice got some idea to have a look.
Chris Hurst
Ranch Hand

Joined: Oct 26, 2003
Posts: 370

Look up J2EE work manager ...

The idea is you create units of work (I mainly work at the moment in Glassfish previously I used Weblogic and I've included some WebSphere info at the end) . Obviously it still results in threads but they are managed / pool'ed by your container and configuration can be exposed by your container.

WorkManager

Just google it for loads of info ...

WorkManager Info


"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread and Web Applications
 
Similar Threads
Struts-JSP: Using for loop to retrieve Message resources that are in an array
getting 2D array view in jsp from actionform properties
JSF hurts my head...
Running Java Processes Question
What are these services?