Questions tagged [barrier]

A barrier is a synchronization method for a group of threads or processes and means they must stop at this point and cannot proceed until all other threads/processes reach this barrier.

A barrier is a synchronization method for a group of threads or processes and means they must stop at this point and cannot proceed until all other threads/processes reach this barrier.

References

252 questions
0
votes
1 answer

C: Equivalent of pthread_barrier_t for windows

As per title, is there an equivalent of pthread_barrier_t type in windows? I' ve found SYNCHRONIZATION_BARRIER but seems available only since Windows 8. Is there something more portable? Thanks
Federico Ponzi
  • 2,682
  • 4
  • 34
  • 60
0
votes
1 answer

general runtime measurement in MPI C

The goal is to measure run-time vs #of processes. I am just a beginner in MPI and get stuck somewhere. I wrote a hello world program and want to test global run-time. I tried using barrier, to make sure all processes terminate before measuring…
0
votes
1 answer

barrier for multiple nodes

I'm trying to get the same functionality as a barrier in interprocess communication, but now for distributed nodes. My problem is that I have multiple distributed processes over nodes. They have some non-deterministic setup, and after the setup I…
hbogert
  • 4,198
  • 5
  • 24
  • 38
0
votes
1 answer

How to prevent temporaryContext run concurrently with migratePersistentStore

I have a code part where I call migratePersistentStore and I want to prevent any temporaryContext to do anything in the same time, how? My idea is based on a semaphore and a dispatch_group. code A: dispatch_group_wait(dgLoadMain,…
János
  • 32,867
  • 38
  • 193
  • 353
0
votes
1 answer

Barrier Function in Matlab

Where can I find the implementation of barrier function in Matlab? I am trying to see how the algorithm interior-point is implemented, and this is what I found in the end of fmincon.m elseif strcmpi(OUTPUT.algorithm,interiorPoint) …
Hong
  • 151
  • 1
  • 2
  • 13
0
votes
1 answer

OpenCL barrier of finding max in a block

I've found a piece of OpenCL kernel sample code in Nvidia's developer site The purpose function maxOneBlock is to find out the biggest value of array maxValue and store it to maxValue[0]. I was fully understand about the looping part, but confused…
melode11
  • 3
  • 1
0
votes
1 answer

Is there any way I can have a barrier within Device code that is controlled by Host?

For example, my code is something like this (but it doesn't work and the kernel stalls): __device__ __managed__ int x; __global__ void kernel() { // do something while(x == 1); // a barrier // do the rest } int main() { x =…
AmirSojoodi
  • 1,080
  • 2
  • 12
  • 31
0
votes
1 answer

Implementing synchronization barriers

On this website http://www.cs.cornell.edu/courses/cs4410/2010fa/synchreview.pdf it says that implementing a barrier for multiple iterations must be implemented in the following way: class Barrier: def __init__(self, N): …
0
votes
0 answers

OpenCL gaussian convolution using one Kernel is slower

I implemented 2D Gaussian Filter on OpenCL using two 1D gaussian filters(gaussian separability). I implemented 2 version of my convolution: - the first one uses one kernel that applies 1D filter on rows and then it transposes the image (it takes…
0
votes
1 answer

Share method local variable value between threads in java

I've been given the task to find the way to share a method's, involved in several threads, local variable, so it's value would be visible for every thread running this method. Now my code look's like this: public class SumBarrier2 implements…
0
votes
1 answer

C pthread_barrier synchronization issues

I'm new to learning about pthread_barriers and how they work. Basically I have two arrays and two threads, one thread finds the max of array A and another finds the min of array B and stores them in global variables. They need to synchronize right…
xCendwar
  • 1
  • 2
0
votes
1 answer

Barrier call stuck in Open MPI (C program)

I am practicing synchronization through barrier by using Open MPI message communication. I have created an array of struct called containers. Each container is linked to its neighbor on the right, and the two elements at both ends are also linked,…
TonyW
  • 18,375
  • 42
  • 110
  • 183
0
votes
0 answers

Testing thread barriers properly

I have implemented a barrier class MyBarrier which has single function wait() on which a calling thread must wait until all threads of his team have arrived. I want to find a good way to test my thread barrier class. Until now I have taken the…
nurabha
  • 1,152
  • 3
  • 18
  • 42
0
votes
2 answers

Understanding "A software combining tree barrier with optimized wakeup" algorithm

I am reading this pseudo code for a barrier synchronization algorithm from this paper, and I could not fully understand it. The goal of the code is to create a barrier for multiple threads (threads can't pass the barrier unless all threads have…
Eran Medan
  • 44,555
  • 61
  • 184
  • 276
0
votes
1 answer

Is this the correct way to thread sync with out mutex

Is this the correct way to sync threads without mutex. This code should be running for a long time #include #include #include #include std::atomic x…
1 2 3
16
17