Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Running a background thread  RSS feed

 
sravanthi adhikari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a situation wherein I want to spawn a thread in the background when the user clicks on a hyperlink, run in and kill the thread when the user clicks on submit on the page. The purpose of the thread is to keep the session alive.
Is this feasible and if someone can help me figure out the risks involved with this , i very much appreacite that.
Thanks,
Srav
 
sravanthi adhikari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one pl reply to my post??
Thanks
 
Vin Kris
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not use the one of the designed session management methods? cookies, url re-writing, HttpSession etc?
or is there something that prevents you from doing so?
can you give some more details?
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont see why this is necessary. You should be able to do this in your main thread. The buttons already have their own thread.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!