636C65616E Posted August 6, 2021 Share Posted August 6, 2021 (edited) 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 ? Regards, Clean Edited August 6, 2021 by 636C65616E evelynwminnick 1 Link to comment Share on other sites More sharing options...
Nine Posted August 6, 2021 Share Posted August 6, 2021 Maybe look at those two mecanisms : https://www.guru99.com/mutex-vs-semaphore.html MSDN : https://docs.microsoft.com/en-us/dotnet/standard/threading/mutexes API : https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createmutexa evelynwminnick 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
636C65616E Posted August 6, 2021 Author Share Posted August 6, 2021 (edited) 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 August 6, 2021 by 636C65616E Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now