Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to generate thread in web application  RSS feed

 
prakash pona
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to create thread for every new topic
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

I'm not sure what you mean by "every new topic" (maybe you can elaborate on that), but creating threads in a web application is no different from creating threads in any other Java environment. Something like this:

would be the simplest way to do it. For more control over thread execution check out java.util.concurrent.Callable and FutureTask.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!