当我在具有断点的本地机器中运行我的项目时它运行良好。但是当我删除断点时我没有完全脱离为什么 [英] When I Am Running My Project In Local Machine With Breakpoints It Works Well .But When I Remove Breakpoint I Am Not Getting Out Perfectly Why

查看:64
本文介绍了当我在具有断点的本地机器中运行我的项目时它运行良好。但是当我删除断点时我没有完全脱离为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在带有断点的本地机器上运行我的项目时,它运行良好。但是当我删除断点时,我没有完全理解为什么

When i am running my project in local machine with breakpoints it works well .but when i remove break point i am not getting out perfectly why

推荐答案

它很漂亮没有看到代码就试图修复任何东西毫无意义,但我可以给你一个想法。



有些情况下你真的可以期待不同的行为在调试器下逐步执行代码或使用断点。为什么?例如,因为时间因素可能很重要。但是如果你不期望这样的效果,那么在调试器下你有不同结果这一事实就清楚地表明你的代码是不正确的。一个可能的解释是相同的时间,对执行时间的不正确依赖性,这可以在任何类型的并行性的情况下被揭示。这种现象以竞争条件的名称为人所知: http://en.wikipedia.org/wiki/Race_condition [ ^ ]。



这是首先要考虑的事情。



-SA
It's pretty much pointless to try to "fix" anything without seeing the code, but I can give you one idea.

There are cases when you really can expect different behavior when you execute code step-by-step or use break points, under the debugger. Why? For example, because such factor as timing can be important. But if you don't expect such effect, the mere fact that you have different results under the debugger is a clear indication of incorrectness of your code. One probably explanation is the same very timing, incorrect dependency on the time of execution, which can be revealed in case of any kind of parallelism. Such phenomena are known under the name "race condition": http://en.wikipedia.org/wiki/Race_condition[^].

This is the fist thing to think about.

—SA


这篇关于当我在具有断点的本地机器中运行我的项目时它运行良好。但是当我删除断点时我没有完全脱离为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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