3 ms·
Debugging is hard regardless of the concurrency model but building an understanding of what the code is supposed to be doing is way easier when the code reads s
by rozap 4y ago
Debugging is hard regardless of the concurrency model but building an understanding of what the code is supposed to be doing is way easier when the code reads sequentially versus async.
As far as debugging changing the scheduling of the program, it's not so bad when the tooling evolves out of the concurrency model, which I imagine will happen once virtual threads catch on in java. For example, in erlang, you can trace processes on a running system by pid, and basically get a sequence diagram of execution with messages between processes and function calls within a process, as well as the actual terms themselves. Because execution doesn't pause, you can even do it in production (if you're careful...). So while it's not a traditional debugger, in the "pause execution here" sense, it's still a way to inspect the system that fits well into an actor model. If such a thing doesn't exist in java already, I'm sure it will soon.
- galaxyLogic 4y agoSo can you actually see a diagram showing one process sending a message to another? Doesn't it become a rather large diagram easily?
- rozap 4y agoYes, and yes can become big, but you can scope it to certain processes, function calls, modules, pattern matches, etc, etc. So it's fine if you know what you're doing. Legend has it that a major cell network was briefly taken offline due to a poorly thought out trace on a production system.