Jump to content

Queued execution of a script

Recommended Posts

I have a script to be called by several other scripts, each running in a separate process.

I would like to have each requesting script queue on a resource (e.g., semaphore), wait for control to be returned, call the target script, and upon return release the resource for the next requestor in the queue. The only common entity between the requesting scripts would be the resource (e.g., semaphore) name.

I believe this differs from the "singleton" issue in the need queuing on and waiting for the named resource and being implemented in the requestor scripts and not the target script.

I've done this in OS/2 and Unix derivatives using semaphores which, by design, form a FIFO queue of requests for the named resource.

Unfortunately, I don't have that level of experience directly with the Windows API calls. I've only done this relative to Windows using Java.

Anyone have an example written in AutoIt using the Windows APIs that does this or some directional thoughts on how to do this.

A pseudo-code example for the requesting script(s) might be

Request named resource and wait for availability

Call target script (Using RunWait, for example)

Free named resource



Edited by obrienj
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...