4 ms·
CSP also encourages writing very racy programs, as the order in which messages arrive in queues can be non-deterministic.
by chrisseaton 6y ago
CSP also encourages writing very racy programs, as the order in which messages arrive in queues can be non-deterministic.
- pkaye 6y agoWhat are the alternatives that are deterministic?
- chrisseaton 6y agoStructured concurrency - fork and join models, or dataflow models, for example. Or clocked models like a physical circuit.
- joubert 6y agoFork-join and dataflow models are parallel computing solutions. Are you suggesting that one should strive to solve concurrency problems with parallel computing approaches?
- valenterry 6y agoNo they are not. You can easily do concurrency with a fork-join approach on just on thread (no parallel execution). fork-join in the browser with e.g. V8 as the runtime is a good example of that.
- aarongolliver 6y agoI wonder how many years of fork() we had before someone finally had a second core to run things on.
- CyberDildonics 6y agoThis is just a nonsense semantic game. Everything gets synchronized or serialized at some point, even if it is hardware that does it.
- chrisseaton 6y agoLook up 'forking web server'. It predates common multiprocessors. Why do you think that is? Because it's useful for concurrency even when there is no parallelism.
- emodendroket 6y agoIsn't that a natural, expected part of concurrent programming? If it has to happen in a particular order, you can't do it concurrently.
- chrisseaton 6y ago> Isn't that a natural, expected part of concurrent programming? No races aren't an inherent part of concurrent programming - you can make it safe. > If it has to happen in a particular order, you can't do it concurrently. I didn't say things had to happen in a particular order, just that their results are merged in a well-defined order. Otherwise you could test against one particular ordering that happens by chance, and then in production you get another order by chance that you didn't test against and it doesn't work! That's what you get with Go.
- emodendroket 6y agoRaces no, but messages coming out of order? You just want to structure your messages in a way that the order doesn't matter
- chrisseaton 6y ago> Races no, but messages coming out of order? Messages coming out of order are a cause of race conditions. > You just want to structure your messages in a way that the order doesn't matter Right... just program without bugs and you won't have any bugs! The problem is people forget to do this, or think they're doing it when they aren't, and they get a failure one in a million. I've done it myself! Why not use a system where it's impossible to depend on message order in the first place?
- emodendroket 6y agoIf you've got a system that makes concurrent programming just as easy as non-concurrent programming I'm sure people are willing to throw a lot of money at you. I'm not aware of any way of doing it that frees you from structuring things so that the order that operations happen in is not important.