0

I have created a Powerbuilder app that has the capability to spawn new threads. Now, these threads will do some background process. I have implemented this one, but the problem is I don't know how to "stop" or "abort" a spawned thread. I tried unregestering the object before destroy objectname and destroy(objectname) but the process still runs on the background. Am I missing something?

Dac
  • 210
  • 3
  • 19

2 Answers2

0

I'm not familiar with Powerbuilder, but based on my experience with Java Threads, I can tell that most likely your spawned threads need to check if they are interrupted somehow. There is no magical "stop" button that will instantly cancel them, they need to reach to a certain state and check for the state themselves. Perhaps the best place to do that is just before the next iteration if they are in a loop somewhere.

Joonas Vali
  • 727
  • 6
  • 11
0

Are you using shared objects to create the new threads? IIRC you can setup an "interface" object to send messages to the new threads. You might be able to use that to call a function on the shared object that shuts things down.

Slapout
  • 3,759
  • 5
  • 40
  • 61