677 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
119
views
Why does Locksupport.park hang indefinitely?
I have the below code (whole code is here) that polls a queue for runnables and parks itself if the queue is empty.
public void waitAndDrain() throws InterruptedException {
throwIfInterrupted();
...
2
votes
1
answer
161
views
Interlocked.* code section guard with minimal inter-core interference?
In order to guard a code section against repeat or concurrent execution we can use Interlocked functionality. Guarding against repeat execution is necessary for things like Dispose(), and guarding ...
4
votes
1
answer
93
views
Can threads in a warp synchronize with different calls to __shfl_sync?
I'm trying to learn Cuda and I'm having trouble to wrap my head around warps and lanes in them. A lane is the word I use for threads inside of the same warp. I can exchange data between lanes as ...
-3
votes
2
answers
186
views
How do you implement reader/writer task synchronization using C# async programming?
This is basic task synchronization 101 but I can't find search terms that tell me what I need to know. And I'm sure it's a dup here.
The classic task synchronization reader/writer problem is you have ...
1
vote
1
answer
217
views
Why did .NET choose to expose both .Wait() and .WaitAsync() on SemaphoreSlim
The SemaphoreSlim exposes Wait() and WaitAsync(). Why did they choose to do this? Imagine I am protecting fields in a class. This class has some properties (synchronous), as some async methods.
We ...
3
votes
2
answers
149
views
CUDA thread mapping
Being a beginner with CUDA my naive model of the following simple kernel
__global__ void sumColumns(float* d_a, float* d_sum, int n) {
if (blockIdx.x < 2 && threadIdx.x < n) {
...
5
votes
3
answers
250
views
Use of volatile with Interlocked.CompareExchange
I came across this blog post by Stephen Toub, demonstrating how to implement an AsyncManualResetEvent:
https://devblogs.microsoft.com/dotnet/building-async-coordination-primitives-part-1-...
2
votes
0
answers
128
views
C# async TCP read/write synchronisation: how to? [closed]
I am trying to create a type capable of sending and receiving traffic on a socket for a real-time application.
I am envisioning a system where this type manages two concurrent queues: one for inbound ...
0
votes
1
answer
118
views
Warp Reduce primitives to threads sharing same value [closed]
I'm facing the problem of reducing values to threads in warps that shares the same variable's content.
More specifically, in order to avoid atomic add operation on the an array i'm evaluating ...
0
votes
1
answer
111
views
Can the Windows API use two mutexes to achieve thread synchronization?
There is a question in my homework: Use mutex to achieve thread synchronization using the Windows API.
I tried using two mutexes to achieve this, but I failed because I found out that a thread cannot ...
0
votes
3
answers
117
views
Java program not producing expected output with synchronized method in multithreading
Problem:
I'm learning Java based on the book by Herbert Schildt "Java The Complete Reference Tenth Edition". I’m working on a Java program with multiple threads, and I'm expecting the output ...
2
votes
0
answers
188
views
Getting "CheckSynchronize called from thread 5994,ドル which is NOT the main thread" error while freeing an object [closed]
I am facing an issue in my program, where I am freeing an object CalcTree which is class type of TVirtualStringTree. This object is used in our program for calculation purposes only. So, while ...
2
votes
1
answer
120
views
How to wait for another thread to loop again?
In my C++17 application I have a thread that runs an endless loop, doing some work (taking some seconds each time) in each iteration.
Now I want to wait in another thread (or in multiple other threads)...
2
votes
2
answers
174
views
How do I make an array threadsafe in Java?
I am pretty new to multithreading and want to understand it better. I want to now how to make an array threadsafe in Java? Meaning I have several threads accessing and changing the data in the array ...
0
votes
2
answers
150
views
How do I sync threads that are in the same block but doing a different operation in cuda c/c++?
I am a 4th year university student who is working on a Parallel computing course project. I have made a very bad decision in selecting the right algorithm to show case the gpu performance compared ...