• Post Reply Bookmark Topic Watch Topic
  • New Topic

Spawn new thread in container  RSS feed

 
Ajit Shanbhag
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What steps need to be taken care of for spawning a new thread in a container? Quick help will be appreciated.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "in a container"? In general, threads can be started by subclassing Thread or implementing Runnable, and then calling the appropriate methods on them.
 
Ajit Shanbhag
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I want to know whether is there a difference in creating a thread in a program and creating a thread in a container i.e. creating a thread in core java program and creating a thread in J2EE. If yes,
I want to create a new thread in a web container. what are the designing factors to be considered for spawing this new thread. I am sorry if I have jumbled with the concept of threading. Actually I am unaware of threading.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no difference between threads created in J2SE code and threads created in J2EE code. But be aware that you shouldn't create threads in some circumstances, for instance, not within EJBs.

You might want to read the Java Tutorial chapter on concurrency to learn more about this.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!