Jump to content

mutex, mutex ... tell me if i can accex

Recommended Posts

Hey there,

I don't know if this is the right place to post ... My question is really windows specific and doesn't concern autoit in first place, but as I don't want to register on other forums for a single question and as AutoIt is microsoft specific (maybe there's some ms experts here) here I am.

So my question is 'quite' simple, but i will just explain some stuff before :

When working on a multithreaded programm, a simple way to handle memory concurrency is to use some locks. Among them, one that i usually use is the CriticalSection : it's damn fast and really easy to implement. In some cases, when computing with high frequencies, the use of a CriticalSectionAndSpinCount enhance the perf by some great factor, by halting the thread with a spin lock before calling the kernel.

Anyway what I presented (CriticalSection and CriticalSectionAndSpinCount) is a feature only usable in a single multithreaded programm.

Now what I want to know: I'm currently working on a distributed programming project, in which i have some shared memory between 2 programms. There is some critical data inside this shared chunk, and i want to use a mutex to switch on and off the read and write rights, there's some computation behind the scene and the read/write is switching quite fast, so using a simple mutex will only result in slowing down the programm in a manner I can't accept.

In the end, long story short : is there, on windows, a way to implement a cross programm mutex *with a spincount* ? or, at least, maybe something equivalent ?



Edited by 636C65616E
Link to post
Share on other sites

thanks, will take some time to dig inside msdn fishing for what could fit the best

To be honest i was asking as a lazy programmer: maybe someone already faced this situation before and could save me the time exploring solutions haha

Edited by 636C65616E
Link to post
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...