critical-section Questions
3
Solved
I'm trying to find the equivalent of a critical section for C++11 , is the new C++11 mutex concept process-bound (e.g. enforces mutex only on the user-space) ? Perhaps it's implementation specific ...
Floaty asked 7/5, 2014 at 13:47
2
I have a 32-bit core timer on a PIC32MZ microcontroller (datasheet) counting at 100 MHz.
The system is running FreeRTOS with multiple tasks (threads) and this code should be able to get called from...
Bisulfate asked 18/1 at 23:32
3
Solved
I have one object with different properties in nodejs, there are different async function which access and modify that object with some complex execution. A single async function may have internal ...
Mathildamathilde asked 6/8, 2016 at 9:57
1
Solved
GPU: Quadro RTX 4000
CUDA: 11.7
I have implemented a global lock by atomic operations like:
__global__ void floatAddLockExch(float* addr, volatile int* lock) {
bool goon = true;
while (goon) {
i...
Bog asked 12/9, 2022 at 8:1
3
Solved
My framework is Laravel 7 and the Cache driver is Memcached. I want to perform atomic cache get/edit/put. For that I use Cache::lock() but it doesn't seem to work. The $lock->get() returns false...
Panocha asked 25/4, 2020 at 18:46
8
Solved
What is the difference between atomic and critical in OpenMP?
I can do this
#pragma omp atomic
g_qCount++;
but isn't this same as
#pragma omp critical
g_qCount++;
?
Noles asked 17/10, 2011 at 18:35
5
Solved
I was reading Critical Section Problem from Operating System Concepts by Peter B. Galvin.
According to it
1) Progress is : If no process is executing in its critical section and some processes wi...
Gymnastic asked 15/10, 2015 at 8:42
6
Solved
I've got this warning recently (VC++ 2010)
warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators
I'm assuming this is the Critical Section. It's been a w...
Quinate asked 30/6, 2011 at 1:11
7
Solved
I was debugging a multi-threaded application and found the internal structure of CRITICAL_SECTION. I found data member LockSemaphore of CRITICAL_SECTION an interesting one.
It looks like LockSema...
Ontiveros asked 12/5, 2009 at 15:16
2
I have some code to print a 2D array to the standard output.
The problem is that when I run it, every process writes to the output and the data overlaps, rendering it unusable.
How can i build a c...
Preoccupied asked 12/1, 2012 at 19:26
1
It seems like CRITICAL_SECTION performance became worse on Windows 8 and higher. (see graphs below)
The test is pretty simple: some concurrent threads do 3 million locks each to access a variable ...
Morley asked 4/9, 2018 at 16:38
1
Solved
I'm trying to set spin count for CRITICAL_SECTION to zero by different methods:
int main()
{
CRITICAL_SECTION cs;
::InitializeCriticalSection(&cs);
printf("Spin count by default %08X\n", c...
Gomuti asked 19/2, 2019 at 11:29
5
On a multi-threaded Linux application I use a mutex for critical sections. This works very well except for the fairness issue. It can happen that a thread leaving a critical section and re-entering...
Jones asked 23/6, 2011 at 5:30
2
I am experienced in implementing critical sections on the AVR family of processors, where all you do is disable interrupts (with a memory barrier of course), do the critical operation, and then ree...
Contextual asked 11/8, 2018 at 0:53
2
Solved
I am trying to create a dumb version of a spin lock. Browsing the web, I came across a assembly instruction called "PAUSE" in x86 which is used to give hint to a processor that a spin-lock is curre...
Fridell asked 15/10, 2012 at 10:52
1
Solved
Why is it imposible to enter critical section without Sleep(1)?
type
TMyThread = class(TThread)
public
procedure Execute; override;
end;
var
T: TMyThread;
c: TRTLCriticalSection;
implement...
Nuris asked 29/11, 2017 at 10:21
3
Solved
I'm trying to implement a critical section in CUDA using atomic instructions, but I ran into some trouble. I have created the test program to show the problem:
#include <cuda_runtime.h>
#inc...
Rinker asked 7/1, 2010 at 14:44
6
Solved
Suppose you have an object which can be accesed by many threads. A critical section is used to protect the sensitive areas. But what about the destructor? Even if I enter a critical section as soon...
Ringnecked asked 15/7, 2011 at 16:22
1
Solved
I recently got myself a dump file generated via procdump when my application remained unresponsive for a while.
When I run !locks on the dump file, I get a lone entry that goes something like:
0:...
Price asked 10/8, 2016 at 17:2
2
Solved
I have a TThread object and want to be able to start/stop the thread via a button on the main form of the program. I've been looking into ways to do this and so far I have the following ideas:
Te...
Hanna asked 21/7, 2016 at 23:48
5
I have the following piece of code in thread A, which blocks using pthread_cond_wait()
pthread_mutex_lock(&my_lock);
if ( false == testCondition )
pthread_cond_wait(&my_wait,&my_lo...
Ningsia asked 28/10, 2009 at 21:56
2
Solved
I'm currently learning Parallel Programming using C and OpenMP.
I wanted to write simple code where two shared values are beeing incremented by multiple threads.
Firstly I used reduction directive ...
Hon asked 3/2, 2016 at 11:35
8
Solved
Are these actually three different concepts or am I getting jumbled? (I've been reading articles about threading and garbage collection together and have confused myself.)
"Critical section" - I t...
Corenecoreopsis asked 14/4, 2009 at 13:24
1
Solved
std::mutex is implemented with critical sections, which is why it's much faster than OS Mutex (on Windows). However it's not as fast as a Windows CRITICAL_SECTION.
Timings just a tight loop in a ...
Electroencephalograph asked 17/2, 2015 at 16:2
10
Solved
I have to implement a read/write lock in C++ using the Win32 api as part of a project at work. All of the existing solutions use kernel objects (semaphores and mutexes) that require a context switc...
Griseofulvin asked 17/6, 2009 at 18:17
1 Next >
© 2022 - 2024 — McMap. All rights reserved.