实时软件过程之间的缓冲通信
假设您有两个流程:服务器和客户机。服务器进程从硬件接口读取一些I/O,并将数据传递给客户机进程。这些进程可能在不同的处理器上运行,也可能不会运行。特别是,它们没有共同的共享内存区域。
In this situation the server and client have to communicate over some explicit pipe between them. This communication mechanism may be implemented in different ways depending on the system. The server part of this system can be run with code similar to the following pseudo-code:
while (1) {
get_data_from_pins();
send_data_to_client();
}
and the client part can run with the following code pattern:
while (1) {
wait_for_then_get_data_from_server();
process_data();
}
In this case, the server initializes the communication and the client waits for and responds to the communication. So the server is the master and the client is the slave. This is perhaps to be expected since the whole process is driven by the arrival of data on the hardware interface. So far, this is simple. However, things get a bit more complicated if timing requirements are taken into account. Depending on the needs of the system, the protocol between the two processes may have to be more complicated.
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !