On 8 Dec 2024, at 12.37, Matthew Browne <mbro...@gmail.com> wrote:I came across this article about concurrency, which makes some pretty bold claims:
That's interesting about exceptions...I know they're controversial, but personally I never found them that problematic or any worse than returning error objects...but most of my experience with them in asynchronous code hasn't been particularly complex asynchronous code. Perhaps I'm missing something.
Re: concurrency vs. parallelism, I don't see any reason why "structured concurrency" couldn't be used for parallelism in addition to concurrency. Couldn't it be as simple (not that this is necessarily super simple to implement) as just having one thread pool for each CPU core, and when an async task needs to be run, assign it to whichever thread pool is most available?
There is an implementation of parallelism for Trio in Python:
https://trio-parallel.readthedocs.io/en/latest/
...and it looks like the same thing would be possible in Kotlin and other languages.
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/object-composition/43DCBD74-9C6F-42B8-81C0-880B09DC3D05%40gmail.com.
I find it confusing. Most inexpert folks (as in this article) do not differentiate between concurrency and parallelism. What they describe in the opening paragraphs could be either. Most operating systems — certainly those with a single core — implement the semantics as parallelism, because concurrency is impossible when you have only one program counter. Parallelism gives the illusion of concurrency — but it is only an illusion.
Hi Egon, thanks for pointing out the discrepancy in definitions. In response to Cope's message, I had done a bit more reading about this and the articles I was reading used "parallelism" to mean truly simultaneously executing on multiple cores, matching the definition from the Go community you mentioned. And without realizing it, that's the definition I was using in my reply to Cope, which was probably confusing.
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/object-composition/b8fc9e63-184e-49b9-be1b-0018c05734ebn%40googlegroups.com.
@Egon et al., so would you say that you disagree with the author's claim that "go" statements (or async/await as the syntax is in many languages) is so harmful to comprehension of asynchronous code that ideally languages shouldn't directly expose those primitives at all? I was struck by the author's claim that the mere presence of a "go" or "await" statement makes the entire program harder to analyze than necessary, and should be avoided in the same way that modern languages don't allow any form of unrestricted "goto" statements.
You seem to be saying that if you are disciplined about sticking to pure message passing (I assume you mean both OO and non-OO messaging), that can work just as well as nurseries or the actor model or other things that impose more rules and structure. But is the risk of misuse worth it given that there are alternatives? I don't mean that as a leading question; I'm not sure I agree with the author either.
It's unclear to me whether the author would consider the actor model (without nurseries) to be too unstructured as well. He might be on to something with the risks of go/async/await keywords even existing in a language, but I wonder if it's one of those things where it should still be available for advanced uses or developers building concurrency libraries, rather than simply being eliminated like unrestricted "goto", which i don't think anyone misses.
For now I'm just curious: is anyone in this group familiar with it, or have you tried it? And if so, what did you think?
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.