Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#5986 closed defect (fixed)

Bad performance of CPLAcquireMutex() on Windows

Reported by: Even Rouault Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

CPLAcquireMutex() in the dfWaitInSeconds > 0.0 case does not perform well if the critical section is already hold by another thread.

This is due to the sleep of 125 ms which can be triggered easily on high contention scenarios. In practice dfWaitInSeconds is almost always set to 1000 to mean "infinite", so in that case we can just call EnterCriticalSection() that will have lower latency than TryEnterCriticalSection() + Sleep(). And in other cases reduce the sleep to 10 ms.

Change History (3)

comment:1 by Even Rouault, 9 years ago

trunk r29302,29303, branches/2.0 r29304 (post RC0) "CPLAcquireMutex(): improve performance on Windows (#5986)"

comment:2 by Even Rouault, 9 years ago

Milestone: 2.0
Resolution: fixed
Status: newclosed

comment:3 by Even Rouault, 9 years ago

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.