473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

mutex by binary semaphore??

If an OS doesnot support mutex and it only has binary semaphore,Is it possible to acheive mutex concept
Jan 13 '07 #1
1 2157
Banfa
9,065 Expert Mod 8TB
Yes just use a semaphore that starts with a count of 1. When you acquire it the count will drop to 0 so no one else will be able to acquire it until you release it.
Jan 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Vinay C | last post by:
Hi, Can anyone clear me that, when should we use go for mutex, and in which situation should we opt for monitor, lock, semaphone and other objects, in a multithreaded application for synchronization...
1
by: rushik | last post by:
Hello all, I m facing an interesting problem related to semaphore in php. We are using a huge business application running on LAMP. For database operations we are maintaining centralized DB...
3
by: smith4894 | last post by:
Hello, I have an application that essentially consists of two threads doing their things. One thread is a producer, and pushes bytes (of a struct) into a pipe, and another is a consumer that...
5
by: marvind | last post by:
I tried using a Semaphore class (have included the full listing reproduced from article Figure 1 at the end of this email) in .NET 1.1. It works fine most of the time, however, I see the following...
2
by: aB£ | last post by:
Hello all, I have an application which will seek the sql server table whether it is updated or not. This application runs once in 60 seconds. But the sql server table doesnt get updated...
8
by: Chris | last post by:
I have an app that is run periodically using Winsows Scheduled Tasks. Occasionally, the app will still be running by the time the scheduled task rolls around again. I don't want the task...
6
by: Jun Kusanagi | last post by:
Is there any way to solve process synchronization between more than 1 resources. I'm already trying to use Mutex.WaitAny, but I confused to execute Release method from the corresponding mutexes....
1
by: mazzawi | last post by:
I know they can be shared if we use pthread_mutexattr_setpshared with PTHREAD_PROCESS_SHARED but does that only work if the processes are created with a fork, after the mutex has been declared,...
0
by: Samuel R. Neff | last post by:
I'm having trouble creating a Semaphore with read-access rights for everyone. Originally I was trying to use this code: semaphore = new Semaphore(maxLocks, maxLocks, "RwLock#" + name); but...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.