LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Priority based semaphore/mutex?

Can anyone describe or point me to information/examples of implementing what amounts to the same functionality as the Labview semaphore scheme but which also takes into account a priority ranking?

 

For example, say job A has locked resource X to run some process. Meanwhile, jobs B, C, and D try to acquire the lock for resource X.

 

Using semaphores, they're queued up on a FIFO basis for when A releases the semaphore. What I'm interested in would be assigning jobs a priority ranking such that when A releases the lock, all queued lock acquisition requests are examined, re-ordered based on priority first, and FIFO second (in the case of jobs having the same priority).

 

So back to the example. Imagine job D has a priority of 8, and the others are 5. After job A releases the semaphore, job D would be next to acquire the resource and the rest of the jobs would remain in their FIFO order.

 

This is a quite common functionality of job shop/flow-shop schedulers, a niche I think Labview is perfectly suited for, that I'm sort of surprised this isn't baked into semaphores but I'm sure others have already climbed this mountain so I'm hoping this post leads me off in a good direction. For whatever reason my searching hasn't led to much, I feel I'm likely unaware of the right search terms for this in the Labview world.

0 Kudos
Message 1 of 2
(2,296 Views)

I know there is a "Priority Queue" library floating around somewhere that Aristos Queue made (and used in the Actor Framework).  You could look into using that with a Queued Message Handler where the QMH handles all the transactions for that resource.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 2
(2,252 Views)