国米pretate logcat的条目:主题ID = 8:撤消后仍然暂停(SC = 1 DC = 1秒= Y) [英] Interpretate Logcat entry: threadid=8: still suspended after undo (sc=1 dc=1 s=Y)

查看:768
本文介绍了国米pretate logcat的条目:主题ID = 8:撤消后仍然暂停(SC = 1 DC = 1秒= Y)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序启动后,我运行约十AsyncTasks。有时模拟器花费大量的时间来启动这些任务。如果发生这种情况,然后我看到日志猫以下消息(S):

I am running around ten AsyncTasks after my application started. Sometimes the emulator takes a lot of time to start these tasks. When this occurs, then i see the following message(s) in the log cat:

D / dalvikvm(1983年):主题ID = 8:撤消后仍然暂停(SC = 1 DC = 1秒= Y)

在模拟器反应快(具有讽刺意味的​​:D),则不会出现此消息。奇怪的行为,而无需修改我所提到的工作行动今天下午发生变化。我觉得很喜欢,因为我明确分配512MB RAM到模拟器,它已不再极其缓慢(〜5min后),相较于快〜5秒。在真实设备上我从来没有过这种反应慢。

When the emulator reacts fast (ironic? :D) then this message doesn't appear. Strangely the behaviour changed while working this afternoon without modifying the action i mentioned. I feel like, since i explicitly assigned 512mb ram to emulator, it is not anymore extremely slow (~5min), compared to fast ~5s. On a real device i never had this slow reaction.

我想了解该日志的猫消息表示。据我所知,线程与指定的ID被暂停,而有此状态下无法正常工作。但为什么?以后有什么复原吗?有什么能(SC = 1 DC = 1秒= Y)是什么意思?

非常感谢提示:)

推荐答案

该消息来自 dvmSuspendSelf(),该线程调用时,调试器(通过JDWP线程)已经要求他们暂停。

The message comes from dvmSuspendSelf(), which threads call when the debugger (via the JDWP thread) has asked them to suspend.

它应该工作的方式是(这里的我们是一个线程):

The way it's supposed to work is (where "we" are a thread):


  • JDWP要求我们暂停

  • 我们告诉它我们已经暂停,睡觉去

  • 最终,调试器唤醒我们,我们重新开始

在条件变量的虚拟机上的信号等待被记录的消息,但由于某些原因,我们仍然标记为暂停。在code注:

The message is logged when the condition variable the VM is waiting on signals, but for some reason we're still marked as suspended. The code notes:

/*
 * The condition was signaled but we're still suspended.  This
 * can happen if the debugger lets go while a SIGQUIT thread
 * dump event is pending (assuming SignalCatcher was resumed for
 * just long enough to try to grab the thread-suspend lock).
 */

在这种情况下,期望的是,我们得到了唤醒时意外的信号到达(如system_server认为有一个ANR因为主线程不响应,因为调试器已暂停的话),如果我们继续循环再调试将有机会清理我们和为我们上了路。

The expectation in this case is that we got woken up unexpectedly when a signal arrived (e.g. system_server thinks there's an ANR because the main thread isn't responding because the debugger has suspended it), and if we loop around again the debugger will get a chance to clean us up and set us on our way.

日志信息是打印自>中值; suspendCount (有多少次我们被告知暂停自己),自> dbgSuspendCount (有多少的暂停请求从调试器来了,所以我们可以撤销所有这些,如果调试器断开连接),以及自>中值;。isSuspended 布尔

The log message is printing the values of self->suspendCount (how many times have we been told to suspend ourselves), self->dbgSuspendCount (how many of those suspend requests came from the debugger, so we can "undo" all those if the debugger disconnects), and the value of the self->isSuspended boolean.

请注意了S = Y标志姜饼消失了 - 顺便线程挂起的作品是的改变

Note the "s=Y" flag disappeared in gingerbread -- the way thread suspension works was changed.

这篇关于国米pretate logcat的条目:主题ID = 8:撤消后仍然暂停(SC = 1 DC = 1秒= Y)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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