Multithread

Started by erezpaz, June 01, 2017, 10:26:00 AM

Previous topic - Next topic

erezpaz

Hi

I am looking for a way to build a small engine that can handle multithread command running so it can run few command or external scripts in the same time and wait for each scripts terminate or kill processes after specific TTL for each or wait for specific error level from each. Can anyone help with this?

Thanks

td

The description of what you are attempting to do is open to multiple interpretations.  For example, if by "multithread" you mean a multi-threaded application in the context of computer operating systems then no one can help you.  WinBatch is not a threaded safe nor multi-thread supporting application.   If you mean something else then you are the best person to help your self by reading up on the various Run* and the ShellExecute function in the help files, and looking at a few examples in the Tech Database archive.  One approach is to create a "Runner" script that starts up several "worker" scripts as separate processes.  The "Runner" script then suspends itself for a predetermined time and then wakes up to check the status of the various worker scripts.
 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

erezpaz

Hi

I can create a while of for loop to start few ShellExecute external scripts and monitor them. I thought there maybe a more smarter way to do it...

Thanks

JTaylor

You might take a look at the Pipe Functions.

The WinSock Extender might have possibilities.    You can Listen on ports with it.

If you are open to Hybrid solutions I posted a WebSocket example a while back.  Not sure if that has any possibilities for you or not.

Jim

JTaylor