viewpoint-particle

Author Topic: Multithread  (Read 486 times)

erezpaz

  • Newbie
  • *
  • Posts: 44
Multithread
« on: June 01, 2017, 10:26:00 am »
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

  • Tech Support
  • *****
  • Posts: 2223
    • WinBatch
Re: Multithread
« Reply #1 on: June 01, 2017, 11:00:26 am »
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.
 
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


erezpaz

  • Newbie
  • *
  • Posts: 44
Re: Multithread
« Reply #2 on: June 01, 2017, 11:25:26 am »
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

  • Pundit
  • *****
  • Posts: 806
    • Data & Stuff Inc.
Re: Multithread
« Reply #3 on: June 01, 2017, 01:18:14 pm »
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

  • Pundit
  • *****
  • Posts: 806
    • Data & Stuff Inc.
Re: Multithread
« Reply #4 on: June 01, 2017, 01:23:09 pm »