Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我正在用 C 编写一个 Unix shell,并且遇到了竞争条件。我已经确定,如果在我的一次 Fork() 调用之后,我可以确保父级在子级之前运行,我可以解决它。有什么方法可以使用信令或任何其他类型的进程间通信来做到这一点?
您可以设置一个信号处理程序并让孩子等待它,例如 SIGUSR1。