Questions tagged [contention]

Questions about any type of resource contention. Use in conjunction with the applicable tag such as [file-access], [memory] or [locking] to indicate the type of resource being referred to.

Questions about any type of resource contention. Use in conjunction with the applicable tag such as , or to indicate the kind of resource being referred to.

88 questions
34
votes
7 answers

Do mutexes guarantee ordering of acquisition? Unlocking thread takes it again while others are still waiting

A coworker had an issue recently that boiled down to what we believe was the following sequence of events in a C++ application with two threads: Thread A holds a mutex. While thread A is holding the mutex, thread B attempts to lock it. Since it is…
Jason R
  • 11,159
  • 6
  • 50
  • 81
15
votes
2 answers

Contention in concurrent use of java.util.Random

Oracle Java documentation says: Instances of java.util.Random are threadsafe. However, the concurrent use of the same java.util.Random instance across threads may encounter contention and consequent poor performance. Consider instead using…
dev
  • 2,474
  • 7
  • 29
  • 47
14
votes
2 answers

Multiple PhantomJS instances hanging

I am having a problem when running multiple instances of PhantomJS on Ubuntu 14. After a few minutes, the processes become unresponsive. Brief background: Using PhantomJS 2.0 to render a web page that ultimately gets saved as a PDF using…
8
votes
1 answer

Same file descriptor after fork()

I'm trying to understand what means duplicating a file descriptor after calling fork() and its possible effects on contention. In "The Linux Programming Interface" 24.2.1 (p517): When a fork() is performed, the child receives duplicates of all of …
omx
  • 83
  • 1
  • 4
6
votes
4 answers

Splitting up a program into 4 threads is slower than a single thread

I've been writing a raytracer the past week, and have come to a point where it's doing enough that multi-threading would make sense. I have tried using OpenMP to parallelize it, but running it with more threads is actually slower than running it…
Alexander Kondratskiy
  • 4,156
  • 2
  • 30
  • 51
5
votes
1 answer

howto measure contention rate of one lock

I'm currently having problems with the contention rate of a partical application (.net 4.0, c#) I'm maintaining. What I would like to do is to write a PerfCounter if one partical lock couldn't be aquired. Right now I just have the overall counter,…
Martin Moser
  • 6,219
  • 1
  • 27
  • 41
5
votes
1 answer

What causes DriveInfo.IsReady to be false?

Situation I'm debugging some legacy code that performs some existence checks on directory paths. First, DirectoryPathA is checked and returned if it exists. This should be the usual case. If that fails, DirectoryPathB is checked and returned. (If…
surface
  • 93
  • 6
5
votes
1 answer

Contention problems in Google App Engine

I'm having contention problems in Google App Engine, and try to understand what's going on. I have a request handler annotated with: @ndb.transactional(xg=True, retries=5) ..and in that code I fetch some stuff, update some others etc. But…
5
votes
1 answer

Unkillable Oracle session waiting on "SQL*Net message from client" event

On Oracle 11gR2, I've recently encountered a very interesting situation involving a blocked (but idle!) MERGE statement that hangs on a "SQL*Net message from client" event, causing subsequent, concurrently executed MERGE statements to block on the…
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
4
votes
4 answers

How can I avoid string.intern() contention and keep the memory footprint low?

I am parsing a rather large (200 MB) XML file that results in a tree of objects each defining a bunch of parameters (key=value). This data structure is running in a Tomcat webapp and used to lookup those parameters. Months ago we discovered a heap…
Stefan Schubert-Peters
  • 5,419
  • 2
  • 20
  • 21
4
votes
1 answer

What happens in NFS if 2 or more servers try to write the same file simultaneously?

I'm working on a PHP webapp that does automatic resizing of images and I'm thinking of storing the cached copies on the NFS mounted NAS so it's easy for me to flush the cache when images are updated. The only thing I'm worried about is what happens…
user126715
  • 3,648
  • 3
  • 23
  • 25
4
votes
3 answers

Per-thread memory management in C#

Continuing the discussion from Understanding VS2010 C# parallel profiling results but more to the point: I have many threads that work in parallel (using Parallel.For/Each), which use many memory allocations for small classes. This creates a…
Haggai
  • 705
  • 1
  • 7
  • 15
4
votes
2 answers

Measuring mutex contention / interpreting mutrace output

I'm trying to measure mutex contention in my program with mutrace, but am stuck as to how to use the report it outputs. mutrace: Showing statistics for process test (PID: 5924). mutrace: 1223 mutexes used. Mutex #362 (0x0x1a23750) first referenced…
goji
  • 6,911
  • 3
  • 42
  • 59
4
votes
5 answers

What type of diagram is best suited for visualizing threading issues such as contentions?

While debugging an issue with our system, I have discovered a thread contention that is causing a bottleneck. I need to explain the phenomenon to other people involved in handling this issue. Some of them are not from development team (yet, they…
akirekadu
  • 2,244
  • 3
  • 24
  • 31
3
votes
3 answers

Easy way to avoid clog collision from different threads?

I have a multi-threaded program where two separate threads are sending debug output to std::clog and the outputs are interspersed. I would like to find an easy way to force the output to at least be kept separate except at line feeds in the output.…
WilliamKF
  • 41,123
  • 68
  • 193
  • 295
1
2 3 4 5 6