锐英源软件
第一信赖

精通

英语

开源

擅长

开发

培训

胸怀四海 

第一信赖

当前位置:锐英源 / 英语翻译 / POSIX同步屏障
服务方向
人工智能数据处理
人工智能培训
kaldi数据准备
小语种语音识别
语音识别标注
语音识别系统
语音识别转文字
kaldi开发技术服务
软件开发
运动控制卡上位机
机械加工软件
软件开发培训
Java 安卓移动开发
VC++
C#软件
汇编和破解
驱动开发
联系方式
固话:0371-63888850
手机:138-0381-0136
Q Q:396806883
微信:ryysoft

锐英源精品开源心得,转载请注明:“锐英源www.wisestudy.cn,孙老师作品,电话13803810136。需要全文内容也请联系孙老师。

POSIX同步屏障

Description 描述

Barriers, are defined in the advanced real-time POSIX (IEEE Std 1003.1-2001), as part of the advanced real-time threads extensions. A barrier is a simple and efficient synchronisation utility. A barrier ensures that all processes in a group are ready before any of them proceed.

同步屏障,被定义在高级实时POSIX(IEEE标准1003.1-2001)中,做为高级实时线程扩展的一部分。一个同步屏障是一种简单而高效的同步实用程序。同步屏障确保所有的过程全部都准备好然后在继续。

Layer 层

It is a high-level RTLinux component, since it do not modifies the existing RTLinux kernel, but adds functionalities to it.

它是一个高级RTLinux组件,因为它不修改现有RTLinux内核,但增加了功能。

API / Compatibility API /兼容性

The API is defined by the POSIX standard. Here is a list of the functions that are going to be implemented.

定义的API是POSIX标准。这里是一个列表的功能实现。

int pthread_barrierattr_destroy(pthread_barrierattr_t * attr );
int pthread_barrierattr_init(pthread_barrierattr_t * attr );
int pthread_barrier_init(pthread_barrier_t * barrier, const pthread_barrierattr_t *attr,
unsigned int count );
int pthread_barrier_destroy( pthread_barrier_t * barrier );
int pthread_barrier_wait( pthread_barrier_t * barrier );
int pthread_barrierattr_getpshared( const pthread_barrierattr_t * attr int * pshared );
int pthread_barrier_wait( pthread_barrier_t * barrier );

Implementation issues 实现问题

Basically, the implementation will consist of two files (pthread_barrier.c and pthread_barrier.h) that implements the functions of the API. This component must not be implemented by means of a mutex, since this is an inefficient method.

基本上,实现将包含两个文件(pthread的barrier.c和pthread的barrier.h)实现API的功能。这个组件不能通过一个互斥对象实现,因为这是一个低效率的方法。

Tests 测试

In order to test the correct behaviour of Posix Barriers, some tests will be provided with the component. Some debugging code will be inserted to validate the component. A barrier can be used to force periodic threads to execute its first activation at the first time. In real-time scheduling theory this is called the critical instant, that is, when all threads want to execute its first activation at the first time. Therefore, barriers will be very useful to implement this synchronisation. The test, in this case, will consist of one barrier. All threads block on the barrier before making periodic. When the last thread arrives to the barrier, then all threads are allowed to continue execution. The chronogram generated must prove how all threads stop before making periodic and are active at the same time.

为了测试正确的Posix同步屏障行为,,将提供一些测试与组件。一些调试代码会插入验证组件。同步屏障可以用来迫使周期性线程在第一时间执行首次激活。当所有线程想要在第一时间执行首次激活,在实时调度理论这叫做临界时刻,。因此,屏障实现这种同步非常有用。测试中,在这种情况下,将包括一个屏障。所有线程在实行定期之前阻塞屏障。当最后一个线程到达屏障,然后所有线程被允许继续执行。生成的定时器必须证明所有线程停止,随后再周期活跃和在同一时间激活。

It also can be implemented some tests to use barriers with client-server systems. For example, as a simple test one thread can write on a fifo whenever other thread wants. This can be implemented by means of a barrier. When the client enters the barrier, then the other thread can follow its execution that consists of a rt_fifo writing operation. The results can be observed in the console.

它还可以实现一些测试,在客户机-服务器环境下的同步屏障测试。举个例子,一个简单的测试,线程能写入到fifo,而它是一个其他线程想要的。这可以通过一个屏障来实现。当客户端进入屏障,那么其他线程可以按照它的执行,包含先进先出写入操作。结果可以在控制台中观察到。

Validation criteria 验证标准

The proposed implementation will relay on special processor instructions to achieve low overhead, instead of using mutexes to synchronise processes.

建议的实施将依赖特殊的处理器指令来实现低开销,代替使用互斥来同步进程。

友情链接
版权所有 Copyright(c)2004-2021 锐英源软件
公司注册号:410105000449586 豫ICP备08007559号 最佳分辨率 1024*768
地址:郑州大学北校区院(文化路97号院)内