CodenameOne
CodenameOne copied to clipboard
Better monitoring of threads
Refer to https://github.com/codenameone/CodenameOne/issues/3753 BackGround: I discovered this problem by an unusual path - I have a multi-threaded search, and because of the danger of thread deadlock bugs, I monitor the searching threads in another thread. and note if they seem to stop making progress. I can only do that indirectly, by monitoring their explicitly published progress metrics. ... so while the actual problem was that the garbage collector had crashed and processes were piling up in "waiting for gc" state, I reported it as a "thread deadlock". The underlying problem, in other circumstances, would be manifest as random lockup/freeze, or worse - very hard to debug.
Request: provide more information about the state of threads. At least "runnable" "waiting for synchronization monitor" "dead" and similar states ought to be possible. Anything else would be gravy, ideally complete information about which threads are waiting for monitors held by which other threads and stack traces. Then a top level watchdog thread could be run to provide an overall gods-eye view of the application.