Questions tagged [mutual-exclusion]

Mutual exclusion means that processes must always execute critical sections in time intervals that do not overlap. The mutual exclusion requirement is one of the most basic in an operating system; without it the OS cannot share resources safely.

261 questions
0
votes
2 answers

How to prevent multiple access to a webpage?

Say I have a web service where I want to serve the content only once. After it is served any other access to that url should generate an error message. How would I go about doing something like this? What if 2 clients access the url in the same…
Kugel
  • 19,354
  • 16
  • 71
  • 103
0
votes
3 answers

VxWorks Mutual exclusion semaphore locked by crashed TASK

I am facing an issue in our C based application where one of VxWorks TASK(say Task1) got crashed due to some unknown reasons. The crashed task had locked a mutual exclusion semaphore(say semA). Now the next TASK2 is waiting on semA to get Unlocked.…
Abhishek
  • 1
  • 1
0
votes
1 answer

one software solution for critical section and challenges

Wait (i) { c[i]=false; while ( c[1-i]) do; } Signal (i) { c[i]=true; } each process try to enter to critical section (CS) for infinite times. process use wait(i) for enter CS, and Signal(i) for exit of CS. i in {0,1} be a number…
user4012783
0
votes
1 answer

Does the following pseudocode have mutual exclusion, indefinite postponement, neither or both?

For the following, I'd like to know what would happen in the case below: //global declarations Boolean in1=false, in2=false; Process P1:: while(1){ //entry protocol while(in2){ in1=true; } //--critical section -- //exit protocol …
0
votes
2 answers

How do monitors enforce mutual exclusion?

So I read that monitors enforce mutual exclusion, mostly by using 2 procedures wait() and notify()/signal() and I also understand problems solved using the monitor. What I want to know is how does a monitor enforce mutual exclusion? What happens…
user2684198
  • 812
  • 1
  • 10
  • 18
0
votes
2 answers

Mutual exclusion expected with comparison operators

I am not a programming genius, but just in the beginning of this year, when being taught propositional logic my teacher told me (and it was quite obvious) that if P is True, not(P) or ~P was False, and the opposite if P was False. Reading the Python…
RGS
  • 964
  • 2
  • 10
  • 27
0
votes
2 answers

What is the best IPC technique which can guarantee mutual exclusion in perl?

I am working on a project where i need to set up a communication between parent process and child processes, i was using named pipes for IPC but i have heard that named pipes won't guarantee mutual exclusion. What would be the best IPC technique…
napster
  • 349
  • 1
  • 4
  • 16
0
votes
3 answers

Thread for dining philosopher. The order of putting down the chopstick

I was creating a thread for a philosopher. Here is the pseudocode: while(true) think get left chopstick get right chopstick eat putdown left chopstick putdown right chopstick Intuitive, i don't think the order of relieving the chopstick…
shle2821
  • 1,856
  • 1
  • 19
  • 26
0
votes
0 answers

Two python scripts writing with mutually exclusive txt file and wait for each other - without threading

I have two scripts running in python on the same machine as endless loops, they are monitoring some values constantly. They communicate via file.txt B adds messages to a file.txt so they pile up. When A checks file.txt it reads them in and empties…
0
votes
1 answer

Distributed Mutual Exclusion: Coterie Formation

I have been studying distributed mutual exclusion algorithms based on the concept of Quorums. Quoting: A Coterie C is defined as a set of sets, where each set g ∈ C is called a quorum. The following properties hold for quorums in a coterie: 1)…
0
votes
0 answers

Creating Mutually Exclusive Check Box List in Asp.Net

I have a check box list which is binded from code behind. There can be at time one check box, two or more. I want to add mutual exclusion property on the same. Is there a way to do so. All the articles I am searching are creating static check box…
Incredible
  • 3,495
  • 8
  • 49
  • 77
0
votes
1 answer

Thread is not waiting for new data using Condition

I'm trying to program something for a lab that basically is a web cache that stores data in a folder so if a client wants to open a webpage, that page will be stored in the cache folder if it is not already there, and it will be showed to the…
0
votes
1 answer

Solving critical section for N processes using semaphores

I am trying to understand the concepts of Semaphores, I have the following piece of code. Initially Semaphore mutex is initialized to 1 Structure of Pi; do{ wait(mutex); Critical Section signal(mutex); Remainder section } while(1); Considering N…
0
votes
2 answers

How to provide a sequence of interleaving threads to show that a code breaks and doesn't provide perfect synchronization?

I know what the following code does and I know why it is a broken code for synchronization as it has only one conditional variable while we need two but I don't know how to provide a sequence of interleaving threads for showing it doesn't work. Can…
Mona Jalal
  • 34,860
  • 64
  • 239
  • 408
0
votes
0 answers

How is completion lightweight compared to semaphore (Linux Kernel)?

Consider a scenario in kernel where we are initiating some activity outside of the current thread, then waiting for that activity to complete. This kind of synchronization could be well achieved by using semaphores. But, it is considered to be a…