About concurrency : does anyone know of a language that would let you tag portions of a codebase in some way, and declare something like "all those methods should execute in the same thread". Those declarations would then be checked by the compiler.
That would be a first step toward agent like concurrency, but it would be general enough to apply to other types of concurrency models.
This is different. COM apartments were a runtime mechanism to magically make the code to run on a single thread (or on multiple but specific threads for MTA), by introducing object proxies that "transparently" marshaled calls.
That's an interesting concept. Would you also suggest having a way of saying "this method should execute in another thread" or "all of those methods should execute in another thread"?
I'm still in the process of figuring how that would work. But mostly it would look something like annotation
@threading("BACKGROUND_WORK_QUEUE_A")
func someWork(data) {}
and you wouldn't be able to directly call someWork() from requestHandler() directly, but calling someSubWork() from someWork() would be fine.
The idea is that i've observed that my code could often be split into parts running in their own threads, and the complex thread splitting code would be at the junction.
Adding annotation like that would help me make sure that a function designed to run inside some part wouldn't accidentaly be called directly from another part.
That would be a first step toward agent like concurrency, but it would be general enough to apply to other types of concurrency models.