4 ms·
It will do what you just described. And what you described won't crash. If you use the int as an offset into raw memory, then sure, that will. But if you use
by sillysaurus3 11y ago
It will do what you just described. And what you described won't crash.
If you use the int as an offset into raw memory, then sure, that will. But if you use it as an offset into a list, then it won't. At most it will cause an exception to be generated. That will cause the reader thread to die, because it was the code that caused the exception, but it still won't crash.
- wtetzner 11y agoRight, but I don't really see how that's freeing. A crash isn't good, but having your program be incorrect might be even worse. If the program crashes, you know it. But it might take some time before you recognize that your logic is wrong, which might cause all kinds of damage. So I don't think it frees you from thinking about concurrency at all.