This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Java in General and the fly likes Misbehaving User Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Misbehaving User Threads" Watch "Misbehaving User Threads" New topic

Misbehaving User Threads

Karthik Veeramani
Ranch Hand

Joined: Dec 22, 2002
Posts: 132
I wrote a c++ wrapper to launch jvm and run a java app. The main class is not a thread, but starts some (user) threads. The cpp program killed all the threads once main returned. So I was trying to retain it, by joining the main thread to one of the user threads. This worked fine (ie, the app ran fine as long as i wanted).
Now I'm making that cpp program as a service. This join() call hangs the service, so the service doesnt start fully. I removed the join call, and started the service. This runs fine for a few seconds, and again all user threads die after that brief moment.
Is there anyway to keep the threads alive?

Thanks<br />Karthik<br />SCJP 1.4, CCNA.<br /> <br />"Success is relative. More the success, more the relatives."
I agree. Here's the link:
subject: Misbehaving User Threads
It's not a secret anymore!