Questions tagged [exclusive-lock]
5 questions
139
votes
5 answers
What's the difference between an exclusive lock and a shared lock?
According to wikipedia:
Shared locks are sometimes called "read locks" and exclusive locks are sometimes called "write locks".
Can you explain the reasoning behind the terms "shared" and "exclusive"?

Rose Perrone
- 61,572
- 58
- 208
- 243
1
vote
1 answer
__sync_add_and_fetch triggers an sError interrupt on raspberry pi 4b
When I use gcc's __sync_add_and_fetch to atomically increment an integer on my raspberry pi4b, the following code is generated:
172e4: c85f7e60 ldxr x0, [x19]
172e8: 91000400 add x0, x0, #0x1
172ec: c801fe60 …

freewill
- 93
- 4
1
vote
2 answers
How to prevent users to write to a text file (over a network share) at the same time using VBA
I have a situation where 3 or 4 people are trying to write in a text file at the exact same time. I would like allow only 1 user at the time writing to the file.
I tried:
Dim FNum As Integer
FNum = FreeFile()
Open "\\SHARE\Logs\File.log" For Append…

UnTroll
- 13
- 2
0
votes
1 answer
PostgreSQL Deadlock between non-relation tables
2022-10-12 20:23:27 KST [40P01] [11983 (4)] ... ERROR: deadlock detected
2022-10-12 20:23:27 KST [40P01] [11983 (5)] ... DETAIL: Process 11983 waits for ShareLock on transaction 12179793; blocked by process
11893.
Process 11893 waits for…

DongHoon Kim
- 386
- 2
- 14
0
votes
1 answer
Exclusive locking of file from Java code doesn't work
I want to exclusively lock text file from Java code, so I found following example:
public class Main
{
public static void main(String args[]) throws IOException
{
String strFilePath =…

Darian Pudic
- 45
- 2
- 10