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
1
vote
1 answer

If Atomic is used, is there a lock contention

This is not specific to any language. Just want to know the "lock contention" terms better. Let us say: we want to execute two kinds of commands using ARM instructions We have 10 stores, each sells product, there is one central boss holding a ledger…
WriteBackCMO
  • 629
  • 2
  • 9
  • 18
1
vote
1 answer

How to make a QComboBox group mutually exclusive?

Once an item is selected on a combo, it should get removed from the others, unless it's "No use". I made three options of QComboBox, and each of those contains the same items. The explanation is this: QCombobox Tug 1 has total 4 items ('No Use',…
Woody Kim
  • 29
  • 8
1
vote
0 answers

With argparse is it possible to have subparsers with dashes?

I want to specify "groups of arguments" like this: fetch-something --basic-auth --user=me --password=myP4ss OR fetch-something --oauth --user=me --client=9038534.client --secret=aslu432409x (similar to this question) I thought I could create…
frans
  • 8,868
  • 11
  • 58
  • 132
1
vote
0 answers

define complex mutual exclusive arguments with argparse

I know there is ArgumentParser.add_mutually_exclusive_group() which lets me choose between mutually exclusive options o1, o2, .. Can I also define 'complex' argument groups which are mutually exclusive? e.g. imagine I had to provide either username…
frans
  • 8,868
  • 11
  • 58
  • 132
1
vote
1 answer

Software mutex not working with out of order execution

In the article https://en.m.wikipedia.org/wiki/Mutual_exclusion#Software_solutions it is given that These algorithms do not work if out-of-order execution is used on the platform that executes them. Programmers have to specify strict ordering on…
zeitgeist
  • 852
  • 12
  • 19
1
vote
1 answer

R - Creating variables with an or exclusion

I have a dataset with some varaibles which indicate if an older can or cannot do an activity (take the bus, bathing...). I have to create some variables like "In group C, the older needs assistance to perform 2 activities including bathing." #In…
Emeline
  • 161
  • 9
1
vote
0 answers

How can I issue multiple asynchronous requests with timeouts and merge their returned values using available python libraries?

I have a web-based resource that can handle concurrent requests. I would like to make requests to this resource asynchronously and store the sum of returned results into a list. This is easy to explain with pseudo-code, but difficult to implement in…
1
vote
1 answer

Can someone help me to understand how Peterson's solution satisfy no-starvation, progress and mutual exclusive condition?

I am also confused about the while loop part, if the condition in the while is not true, then how it is going to get into CS? How does this Peterson's solution satisfy the conditions of Mutual exclusive, no-starvation and progress condition? Thank…
xxColderxx
  • 53
  • 6
1
vote
3 answers

Looking for an appropriate synchronization mechanism

Presume I have the following (pseudo) code: class Cache { Entry addIfMissing(String data) { // omitted for brevity } void evictOldEntries() { // omitted for brevity } } class Program { private Cache cache = new…
John Reese
  • 583
  • 2
  • 6
  • 17
1
vote
0 answers

Peterson's solution for process scheduling

I'm trying to understand the Peterson's solution for mutual-exclusion problem so I'm sure that it works when process scheduling is preemptive but what happens when the scheduling is nonpreemptive? I read that it might crash when preemptive. So if I…
1
vote
4 answers

Mutual exclusion: is this safe?

Is this pattern for mutual exclusion as safe as I think it is? If so, what do you call it? lock (_lock) { if (_flag) return; else _flag = true; } try { //critical code... } finally { _flag = false; } I want to ensure the critical…
marijne
  • 2,992
  • 5
  • 22
  • 21
1
vote
1 answer

How spinlock prevents the process to be interrupted?

I read an answer on this site says the spin-lock reduce the overhead with context switches, and after that I read an textbook statement related to this: Spin-lock makes a busy waiting program not be interrupted. My question is on the title. Since…
1
vote
1 answer

Concurrent Tasks based on hierarchy and scheduled

I want to achieve the following: Let's say I have these tasks: #1 - Executed every 10 seconds. #2 - Executed every 2h, needs consistent results from #1. #3 - Executed every day at 10:00 and 22:00, needs consistent results from #1. #4 - Executed…
1
vote
0 answers

Implementation of Dijkstra’s mutual exclusion algorithm

I am trying to implement a Dijkstra's algorithm into a fork/join threadpool (consists the main threadpool with a global task queue and N threads with its own task queue) based on Dijkstra's Solution of a problem in concurrent programming control and…
1
vote
1 answer

Mutual exclusion across user session in Citrix environment

I have an application that runs in Citrix environment. The application can be run simultaneously by several users in different user sessions. In my application I am writing to a file which should be mutually exclusive across all the user sessions. I…
aJ.
  • 34,624
  • 22
  • 86
  • 128