8 ms·
What is it called when you live in an environment where X is not available and so you convince yourself that X is a bad idea?
by newen 7y ago
What is it called when you live in an environment where X is not available and so you convince yourself that X is a bad idea?
- rwmj 7y agoI used shared memory concurrency all the time, you're simply wrong.
- pjmlp 7y agoModern security exploits and application crashes due to state corruption have proven that while threads were an enticing idea, they aren't something that we should keep around if we care about security and application stability. This applies to all programming languages, not only OCaml, hence why everyone is moving away into other concurrency models anyway.
- amelius 7y agoThere are many applications where these kind of security issues don't apply.
- pjmlp 7y agoSuch as? Every application should strive for proper quality, just like in other industries.
- amelius 7y agoFor example: embedded applications, or when I'm the only one running trusted code on my computer. Think also of scientific computing. If you insist on networked solutions: database servers. Also: "multicore + purely functional style" is just as clean as "multiprocess + purely functional style", but ... the latter is less efficient because of communication overhead.
- pjmlp 7y agoUnless you manage to do any kind of work without IO, there is always a security risk. And if that is irrelevant to you, there is still the application stability and memory consistency to ensure data is being handled in a memory consistent state. Fortran is a good example on how to do scientific computing without low level threads.
- amelius 7y agoYes threads should be used with extreme caution, that's why I advocate using a functional programming style. But you still want the performance of multicore. It's not one or the other (but with OCaml it unfortunately is).
- newen 7y agoYou have two matrices, with allocated memory A and B, that you want to multiply and store to allocated memory C, as efficiently as possible using 8 cores. How do you do this without threads exactly?
- pjmlp 7y agoVector instructions or GPGPU.
- newen 7y agoAssume no GPU. Vector instructions will only use one core at a time.
- pjmlp 7y agoWe are in 2019, even low level microcontrollers have dumbed down GPUs. Plus I already answered your questions, not moving goal posts here.
- detaro 7y agoAnd will spend more time shuffling data through their horribly bottle-necked memory interfaces than the CPU would take handling the matrix operation, especially if the GPU is already used for graphics. Multi-core systems and tools that can use them are valuable and very much reality right now.