The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
2answers
53 views

Using `sem` to make a script run in parallel

I have the following shell script (one liner), which I wanted to use to identify directories that have the exact same contents. I'm using it, to identify and remove duplicate (child) directories. ...
1
vote
2answers
60 views

Where is a named semaphore stored? [closed]

A named semaphore (using semaphore.h) is identified by a name in the form /somename; that is, a null-terminated string of up to NAME_MAX-4 (i.e., 251) characters consisting of an initial slash, ...
5
votes
1answer
136 views

Performing atomic write operations in a file in bash

After going through the bash documentation, this question and this one it's still not clear to me how can I perform atomic write (append) operations to a file in bash. I have a script that is run in ...
0
votes
0answers
134 views

scripts/checkpatch.pl: Warning: consider using a completion

I'm currently writing a kernel driver that involves moving large amounts data from userspace to or from a peripheral, via a ring of bounce buffers. The buffer completion callback ups a semaphore, and ...
2
votes
0answers
72 views

process waiting for a semaphore

If I have a process that is in sleep state and i can see in ps' column WCHAN that is waiting to obtain a semaphore, is there any way to find the adress of that semaphore?
1
vote
0answers
378 views

How to debug a semop failure?

Using a 2.6.30-gentoo-r4 Linux a very complex system of php code is executed (with 4.4.9-pl0-gentoo and 5.2.10-pl0-gentoo), which occasionally runs into a semaphore blocking problem. The call to the ...
10
votes
1answer
26k views

How to get proccesses currently running semaphores by /proc?

I wonder how to get processes currently running semaphores by /proc ? I guess it's possible by SysVIPC subdirectory.But I don't know how to use this commands. Ubuntu 12.10
4
votes
1answer
13k views

How do I increase the number of semaphore arrays in Linux?

In a Debian lenny server running postgresql, I noticed that a lack of semaphore arrays is preventing Apache from starting up. Looking at the limits, I see 128 arrays used out of 128 arrays maximum, ...
11
votes
3answers
23k views

what is the difference between spin locks and semaphores?

What are the basic differences between spin locks and semaphores in action?
3
votes
3answers
10k views

Why are spin locks good choices in Linux Kernel Design instead of something more common in userland code, such as semaphore or mutex?

I understand that Spinlocks are real waste in Linux Kernel Design. I would like to know why is it like spin locks are good choices in Linux Kernel Design instead of something more common in userland ...
29
votes
7answers
12k views

What Unix commands can be used as a semaphore/lock?

I want to run multiple Bash shell scripts in parallel. However, I want to avoid race conditions. What Unix commands are truly atomic that I could use for this purpose, and how can I use them?