Idle Main Thread, Active Secondary thread?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am converting some legacy code to a VB Windows app. The original program uses a menu to call one of a set of subroutines which process transactions according to operator input at a terminal. When the task is done, completion information is passed back through the subroutine's parameters

What I want to do is create a subroutine that retrieves the parameters, spawns a thread to do the work, and goes to sleep until the working thread wakes it up. On waking it needs to close down the working thread, set the parameters to the new values, and return to the calling program

I'm trying to move a system of 105 subroutines from a procedure-driven (mainframe) environment to an event-driven (Windows) environment without having write the whole mess over from scratch. I have written a translator that ports the code and the screen definitions. It turns out that was the easy part

Can someone show me how to do this, or give me any suggestions, sample code, or other help?

Thanx!
 
Jim,
spawns a thread to do the work, and goes to sleep until the working thread wakes it up. On waking it needs to close down the working thread,

Why not just do the work on the main thread?



Mattias
 
Mattias,

thread wakes it up. On waking it needs to close down the working thread,
Why not just do the work on the main thread?

Very good answer (serious) and I completly agree with you.

Cor
 
Back
Top