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
2
votes
1 answer

Image loading/caching off the main thread

I am writing a custom image fetcher to fetch the images needed for my collection view. Below is my image fetcher logic class ImageFetcher { /// Thread safe cache that stores `UIImage`s against corresponding URL's private var cache =…
2
votes
1 answer

What is "implicit synchronization" in OpenMP

What is exactly "implicit synchronization" in OpenMP and how can you spot one? My teacher said that #pragma omp parallel printf(“Hello 1\n”); Has an implicit sync. Why? And how do you see it?
alienflow
  • 400
  • 7
  • 19
2
votes
4 answers

Barrier doesn't set to referenceIds in constraint layout?

hey last few days I am exploring about the constraint layout.the concept of barrier I can understand but when i implement I can't get the correct output. I want to set the barrier in the right direction to reference Id's. But barrier doesn't work.it…
2
votes
1 answer

inline svg - how to apply browser default styles to xhtml in foreignObject?

i have an inline svg with foreignObject elements which contain xhtml fragments. however, the xhtml content is improperly styled due to crosstalk from styles set through js in the svg and its parent html document (namely the jqtouch library). thus…
collapsar
  • 17,010
  • 4
  • 35
  • 61
2
votes
0 answers

OpenMP barrier implementation on MacOS

I have been playing around with openmp and have used barrier construct to execute a simple code: #include #include int main() { int i = 0; int x[100]; int tid; int y[100]; int z[100]; for(i=0;i<10;i++) x[i]==i; …
2
votes
3 answers

Does barrier (e.g. CyclicBarrier) cause deadlock when the amount of thread passed it is smaller than the barrier limit?

When running the following code, the 2 start threads will be locked by the CyclicBarrier *object and waiting for the third thread infinitely to be unlocked import java.util.concurrent.BrokenBarrierException; import…
Rui
  • 3,454
  • 6
  • 37
  • 70
2
votes
0 answers

Random walk algorithm for pricing barrier options

How to realize the random walk algorithm with MATLAB? I don't understand this algorithm, because the condition 3 never holds. I post my code in the end. Choose a time-step h>0 so that M=9/h is a integer. Set log(L_0) = L_0 = 0.13 and…
2
votes
1 answer

Why a `atomic_signal_fence` is used here when getting system time

I found this function in a github repo which implements a lockfree queue. This function uses the QueryPerformanceCounter to get accurate system time. #define CompilerMemBar() std::atomic_signal_fence(std::memory_order_seq_cst) SystemTime…
calvin
  • 2,125
  • 2
  • 21
  • 38
2
votes
2 answers

Execute multiple blocks concurrently in a dispatch barrier

I want to send 2 types of requests to a web service. The first is a POST which changes the backend state. The second is a GET which retrieves data from the backend. I want to be able to have multiple POST requests sent concurrently since they won't…
2
votes
1 answer

GCC Inline Assembler "memory" Clobber don't prevent from re-arrange the code in ARM

I read article about GCC Inline Assembler (http://www.ethernut.de/en/documents/arm-inline-asm.html). In this article, "memory" Clobber forces the compiler to store all cached values before and reload them after executing the assembler instructions.…
lumotuwe
  • 21
  • 4
2
votes
1 answer

No resource identifier found for attribute 'barrierDirection' in package - ConstraintLayout Barrier

I am trying to run a sample program for a training hosted at GitHub (https://github.com/googlecodelabs/constraint-layout). I updated the build.gradle to fix build errors, but I cannot get it to compile and run. I am getting No resource identifier…
ethan
  • 346
  • 3
  • 16
2
votes
1 answer

Do I need memory barrier for accessing memory modified by the thread that finished?

[Hereinafter, C++ terms] I have a thread A and thread B that share access to the integer value P. Thread A initializes this value and updates it while running. Then thread A completes. Thread B waits for thread A to complete (standard OS API call,…
nsh
  • 380
  • 3
  • 9
2
votes
1 answer

Waiting for OpenMP task completion at implicit barriers?

If I create a bunch of OpenMP tasks and do not use taskwait, where does the program wait for that tasks completion? Consider the following example: #pragma omp parallel { #pragma omp single { for (int i = 0; i < 1000; i++) { …
Daniel Langr
  • 22,196
  • 3
  • 50
  • 93
2
votes
1 answer

Free all waiting threads

I'm writing this class that simulates a barrier point. When a thread reaches this barrier point it cannot proceed until the other threads have also reached this point. I am using a counter to keep track of the number of threads that have arrived at…
Amous
  • 534
  • 5
  • 18
2
votes
1 answer

MPI_Barrier - Only some processes passes the barrier

I'm facing a situation where only some processes bypass the MPI_Barrier function. The problem appears in this fragment of code: printf("[%d] Before barrier\n", mpi_rank); fflush(stdout); MPI_Barrier(MPI_COMM_WORLD); printf("[%d] After barrier\n",…
dv_
  • 169
  • 10