3 ms·
Years and years ago I took an OS course and the professor made us use this weird language called concurrent sp/k It was a language based on pl/1 with interesti
by m463 6y ago
Years and years ago I took an OS course and the professor made us use this weird language called concurrent sp/k
It was a language based on pl/1 with interesting parallel primitives, like cobegin/coend, monitor and a bunch of other things where you could express your parallel needs in different ways. Even years and years later I remember that experience.
Since then I haven't seen cobegin/coend anywhere except in slides, and I haven't seen monitor at all (If I recall correctly it was a critical section allowing only one process inside)
I think the library-based parallel programming scheme is ok, but it might be time to build it into common languages and tools.
- spacedcowboy 6y agocobegin/coend sound very much like co-routines, which is a relatively simple implementation of co-operative multitasking[1]. I've seen it used a lot in embedded programming, and the original Mac OS (pre os-x) was co-operative. Not so common these days with linux/freeRTOS/others providing pre-emptive multitasking As for 'monitor', that's a standard term for a high level synchronization concept - basically shared data between tasks, but you can only access that data via the monitor's procedures, and it enforces one-at-a-time access. You can create a monitor with a semaphore and a class-with-private-ivars, assuming all the accessors wait on the semaphore. [1]: https://en.wikipedia.org/wiki/Coroutine https://en.wikipedia.org/wiki/Coroutine
- m463 6y agoI honestly have never done cooperative multitasking, but I think cobegin/coend were: cobegin stmt_a stmt_b stmt_c coend when the construct is entered a b and c were all executed in parallel. My thought was that a construct like that would be clumsy to do with library-based multitasking