Jump to content

Cross platform semaphore?

Recommended Posts

Does anybody have any tips on implementing "hardware" sharing between two different systems running two different .exe's?

What I'm looking for is a "semaphore" that will work between different pc's across a network and between different compiled .exe's.

The end result is to inhibit a particular test that will interfere with another test that is running at the same time.

Thanks in advance!

Link to post
  • 1 month later...

In not EXE application you can use LV syncronization utility to syncronize two or more application in a network calling the same .llb, for ex queue or semaphore, form all applications... but in EXE you can't do this.

In this cases i implement a custom network protocol for share varius information and therefore syncronization data between different applications.

The next LV version would implement functionality to develop network distributed applications... it could resolve your problems :)

Bye, Alessandro.

Link to post

Hi Ale914:

There must be an easier, and more elegant way to do this, but, if worst comes to worst, and if both systems can read and write to a common directory location, you can use a small dummy file as a semaphore.

When application #1 wants to grab the hardware, it first opens the dummy file for edits and prohibits access by other applications. Application #2 then would get a file error when it tried to open the dummy file, and would have to wait its turn, until App #1 released the hardware, and closed the dummy file.

I know this is rather kludgey, but we used it a lot in the bad old days, and if no one suggests something more elegant, it will probably still work today.

Hope to have been of help & Best Regards, Louis

Link to post

I would suggest making a third exe: a resource controller. This third exe publishes data to a datasocket server (on itself or another machine). The client exe's check the tags the datasocker server for whether the resource is "in use". Bet this app could be written in under 5 minutes :D

Link to post

Here's how I solved it:

Since both apps were accessing a SQL server DB. I just created a small table in that database to "token" pass between the two apps.

I decided to go this way, because we could potentially have half a dozen machines accessing the hardware in the future.

I would prefer direct communication because SQL may not always be available, but it works quite well for now.


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.