What kind of concurrency models are being considered? #1491
Replies: 4 comments 3 replies
-
Yes, I'm also curious about this question~ Because a lot of modern programming languages try to solve the problem, and I didn't read it in carbon's document. |
Beta Was this translation helpful? Give feedback.
-
From what I can tell, it has support for something close to C++20 coroutines with the __await, __run and __continuation keywords. See https://github.com/carbon-language/carbon-lang/tree/trunk/explorer#experimental-feature-delimited-continuations Anything higher level, such as tasks, executors, actors, etc. I imagine would likely be implemented as libraries. Carbon also implements the C++ memory model for atomics. |
Beta Was this translation helpful? Give feedback.
-
The coroutines are really an early experiment. The |
Beta Was this translation helpful? Give feedback.
-
I've been using a C++ based Actor library for the last 5 years, and the biggest issue with a language which doesn't fundamentally support Actors is that there is no mechanism to prevent a client from manually invoking the "Behaviour" function instead of using the async messaging framework. Also, sharing data amongst Actors is problematic - a non Actor language will happily share a pointer. To safely use an Actor framework, the compiler really needs to understand that it is dealing with an Actor object which restricts how others interact with the Actor. I have written an Actor library for C++, but I wouldn't recommend inexperienced developers use the Actor model without language support. Pony showed promise, and would have been great without GC. Sadly, that language is gone. |
Beta Was this translation helpful? Give feedback.
-
Are go like coroutines (Communicating sequential processes), task oriented async patterns or actor model being considered for carbon?
Beta Was this translation helpful? Give feedback.
All reactions