Barrier (computer science)

 

Barrier (computer science)

From Wikipedia, the free encyclopedia

 

Jump to: navigation, search

 

[edit] Threads synchronization primitive

In parallel computing, a barrier is a type of synchronization method. A barrier for a group of threads or processes in the source code means any thread/process must stop at this point and cannot proceed until all other threads/processes reach this barrier.

Many collective routines and directive-based parallel languages impose implicit barriers. For example, a parallel do loop in Fortran with OpenMP will not be allowed to continue on any thread until the last iteration is completed. This is in case the program relies on the result of the loop immediately after its completion. In message passing, any global communication (such as reduction or scatter) may imply a barrier.

[edit] Processor and compiler barriers

Memory barrier is a class of instructions which cause a processor to enforce an ordering constraint on memory operations issued before and after the barrier instruction.

A barrier can also be a high level programming language statement which prevent the compiler from reordering other operations over the barrier statement during optimization passes. Different classes of barrier exist and may apply to a specific set of operations only.

[edit] Dynamic Barriers

Classic barrier constructs define the set of participating processes/threads statically. This is usually done either at program startup or when a barrier like the Pthreads barrier is instantiated. This restricts the possible applications for which barriers can be used.

To support more dynamic programming paradigms like fork/join parallelism, the sets of participants have to be dynamic. Thus, the set of processes/threads participating in a barrier operation needs to be able to change over time. X10 introduced the concept of clocks for that purpose, which provide a dynamic barrier semantic. Building on clocks, phasers[1] have been proposed to add even more flexibility to barrier synchronization. With phasers it is possible to express data dependencies between the participating processes explicit to avoid unnecessary over-synchronization.

[edit] References

  1. ^ Shirako, J.; Peixotto, D. M.; Sarkar, V.; Scherer, W. N. (2008). Phasers. pp. 277. doi:10.1145/1375527.1375568.  edit

 

the original link: http://en.wikipedia.org/wiki/Barrier_(computer_science)

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值