使用条件变量并在同一程序中同步是危险的吗? [英] Is it dangerous to use condition variables and synchronized in the same program?

查看:73
本文介绍了使用条件变量并在同一程序中同步是危险的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它是否危险并且可能导致什么问题?

Is it dangerous and can what problem could it cause?

推荐答案

试图重新发布,获得第二意见?无论如何,我已经解释过了:你的代码是没有意义的,是的,这很危险,但是在这个公式中没有什么可以说肯定的:它取决于代码。



再看一遍:这是否足以确保相互排斥? [ ^ ]。



-SA
Trying to re-post, to get second opinion? Anyway, I already explained it: your code is pointless, and yes, this is dangerous, but in this formulation nothing can be said for certain: it depends on the code.

See again: Is this enough to insure mutual exclusion?[^].

—SA


这篇关于使用条件变量并在同一程序中同步是危险的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆