如何使用任何方法编写线程同步代码 - 例如..Cevent

发布于 2024-09-08 16:06:04 字数 294 浏览 3 评论 0原文

你好,我正在尝试编写一个简单的应用程序,它将帮助我从串行端口读取数据并使用单个线程写入同一个串行端口...所以有人可以帮助我管理线程之间的同步吗?源代码 - Visual studio 6 中的整个项目文件 - http://rapidshare.com/files/ 406340281/SerialPortTest.rar

谢谢

Sayonee

hello there I am trying to code a simple application which would help me in reading from a serial port and write to the same serial port using a single thread ...so could someone please help me to manage the synchronization between the threads.heres the source code- the whole project file in Visual studio 6 - http://rapidshare.com/files/406340281/SerialPortTest.rar

Thanks

Sayonee

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

满意归宿 2024-09-15 16:06:04

添加同步的最简单方法是使用 CRITICAL_SECTION。

尝试找到不应同时设置/执行的变量/函数/...,并使用关键部分保护它们。

The easiest way to add synchronization is to use a CRITICAL_SECTION.

Try to find variables/functions/... that shouldn't be set/executed at the same time and protect them using a critical section.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文