FAQ Database Discussion Community


Task vs Barrier

c#,task,barrier
So my problem is as follows: I have a list of items to process and I'd like to process the items in parallel then commit the processed items. The barrier class in C# will allow me to do this - I can run threads in parallel to process the list...

Python 2.7 Multiprocessing Barrier

python,python-2.7,multiprocessing,barrier
I am using Python 2.7, and have been converting multithreaded code to multiprocessing code to avoid GIL lock problems. However, I don't see a barrier implementation in the multiprocessing module (Any ideas how to implement one?). I saw this question: Is it possible to use multiprocessing.Event to implement a synchronization...

OpenCL barrier of finding max in a block

parallel-processing,max,opencl,gpgpu,barrier
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 about the unroll part: Why the unroll part...

pthread_barrier_wait hangs after creation of all threads

multithreading,pthreads,barrier
I'm trying to write a simple program to use a barrier to wait for the creation of several threads before printing a message from the main. Here's my code: #include <iostream> #include <pthread.h> #include <stdio.h> #include <cstdlib> #include <cstdint> #define NUM_THREADS 8 pthread_barrier_t barrier; void *threadFun(void *tid) { intptr_t temp...

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

cuda,barrier
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 = 1; kernel<<< 1, 1 >>>(); x =...