Jump to content

Sychronizing Processes


Recommended Posts

Hello Everyone,

I currently have 3 parallel processes. 1) handles the user interface. 2) Make calls to the device, and writes it's data to a file. 3) Acquires the sense voltage. 1 & 2 are correlated in some way(same devices), and I would like to synchronize it's task so that it does not do read and writes concurrently. I used a Semophore to seperate the task. However, the problem is that I am not writing to the file at precisely one second, it is off by +15ms every 5 seconds or so. I am considering using a Rendevous instead of a Semaphore, is this the right approach? Thanks in advance.

Vince

Link to comment

Hey nevermind. The problem I had was that I set the timeout for event structure to be 100ms. Once I changed that to 99ms it was pretty accurate. I am still using a semaphore. The main problem I have now is that I don't have access to the hardware we are using, so I've been running in simulation mode. I am quite sure the timing will be influenced by the hardware, and other processes that utilize window's resources. What methods are there to make sure that I write the file at appropriate times. :question: I would hate to recompensate the timeout everytime there is a hardware change. :wacko:

Thanks Again,

Vince

Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.