3 ms·
> Yet threads make backtraces and control flow much less useful, since they miss out important context from concurrent threads. Threads' contexts should be ind
by white-flame 7y ago
> Yet threads make backtraces and control flow much less useful, since they miss out important context from concurrent threads.
Threads' contexts should be independent from each other. If reading your stack trace relies on the state of other threads, you've got a very brittle design.
What is lost is the history of the state the current thread is working with, but the state should be fully encapsulated within the thread, except in the case of large shared read-only input buffers that are being processed in parallel. But those latter buffers aren't hidden from the current thread nor its debugging. Debug information can also be logged on state objects to show its provenance.
- jrochkind1 7y ago> but the state should be fully encapsulated within the thread, except in the case of large shared read-only input buffers Sure. The trick is that the thread design does not ENFORCE that, threads as an abstraction involve shared memory. > If reading your stack trace relies on the state of other threads, you've got a very brittle design. Or a bug. And a bug or a brittle design is exactly when you need a debugger the most, right?