contention

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

不问归期 提交于 2019-12-18 16:52:32
问题 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 with one. Reading over other similar questions, especially about OpenMP, one suggestion was that gcc optimizes serial code better. However running the compiled code below with export OMP_NUM_THREADS=1 is twice as fast as with export OMP_NUM_THREADS=4

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

大兔子大兔子 提交于 2019-12-12 09:01:54
问题 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 in general with NFS if 2 or more of the servers in the cluster are trying to create the same image cache file at the same time? There's a pretty good chance that when the cache gets flushed for content updates that they could collide like that, but

What can I do to programmatically prevent or limit Resource contentions?

我的梦境 提交于 2019-12-12 07:04:03
问题 I have created an app that, given enough data, fails to complete, with "The transaction log for database 'tempdb' is full due to 'ACTIVE_TRANSACTION'." and "Cannot find table 0." The Stored Procedure that the report uses does not explicitly reference "tempdb" so it must be something that SQL Server manages on its own. Anyway, I ran the "Resource Contention" analysis in Visual Studio 2013 via Analyze > Performance and Diagnostics. When it finished, it told me in the "Concurrency Profiling

Why there are contentions in places with no lockings?

僤鯓⒐⒋嵵緔 提交于 2019-12-11 07:09:12
问题 I run a concurrency profile of a software in Visual Studio 2010 and found some contentions on lines of code that are not within locks. Say, a new operation to create an array, or a thread-local DynamicMethod.Invoke call. Some contentions are on simply assignments. I could not figure out why these lines cause intentions because there should be no way they are under any lockings in my code. Anyone experiences similar problems? I think the contentions displayed in VS2010 concurrency profiler

oracle row contention causing deadlock errors in high throughtput JMS application

穿精又带淫゛_ 提交于 2019-12-11 01:49:01
问题 Summary: I am interested in knowing what's the best practice for high throughput applications that have bulk messages trying to update the same row and get oracle deadlock errors. I know you cannot avoid those errors but how do you recover from them gracefully without getting bogged down by such deadlock errors happening over and over again. Details: We are building a high throughput JMS messaging application. Production environment will be two weblogic 11g nodes (running 6 MDB listener

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

邮差的信 提交于 2019-12-10 14:21:35
问题 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 first statement via "cursor: pin S wait on X" events. In Oracle Enterprise Manager, the following can be observed: This situation turns even more severe, as the above Session-ID 1204 cannot be killed with either: alter system kill session 'sid

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

筅森魡賤 提交于 2019-11-30 14:13:11
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 with one. Reading over other similar questions, especially about OpenMP, one suggestion was that gcc optimizes serial code better. However running the compiled code below with export OMP_NUM_THREADS=1 is twice as fast as with export OMP_NUM_THREADS=4 . I.e. It's the same compiled code on both runs. Running the program with time : > export OMP_NUM

Contention in concurrent use of java.util.Random

房东的猫 提交于 2019-11-29 09:26:47
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 ThreadLocalRandom in multithreaded designs. What might be the reason behind poor performance? jcarvalho Internally, java.util.Random keeps an AtomicLong with the current seed, and whenever a new random number is requested, there is contention in updating the seed. From the implementation of java.util.Random: protected int next(int bits) { long oldseed,

Contention in concurrent use of java.util.Random

核能气质少年 提交于 2019-11-28 02:52:27
问题 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 ThreadLocalRandom in multithreaded designs. What might be the reason behind poor performance? 回答1: Internally, java.util.Random keeps an AtomicLong with the current seed, and whenever a new random number is requested, there is contention in updating the

Per-thread memory management in C#

做~自己de王妃 提交于 2019-11-27 16:57:06
问题 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 contention on the global memory allocator thread. Is there a way to instruct .NET to preallocate a memory pool for each thread and do all allocations from this pool? Currently my solution is my own implementation of memory pools (globally allocated arrays