I'm refining the implementation of Event/process and Condition/process. I ran
into a situation where reader(shared)/writer(exclusive) lock is
wanted. Actually, similar mechanics is already used inside the implementation
of Stm/threads, now it seems that I should do something similar for
process. This led me to think: if it's so frequently used, rather than embedded
them as insider helper, how about provide them as enhanced modules?
For example, the standard modules can extended in the following ways
- Mutex: support reader/writer locks
- Condition: support capacity
- Event: support future
What do you think?
On the other hand, I really have problem in naming them. They are enhanced (but
not compatible) version of the original modules. For example, in the new Mutex
module, ''lock'' function will take a optional variable indicate how the mutex
should be locked (shared or exclusively), this is not compatible with original
Naming them as "Comutex" "Cocondition" "Coevent" is a bit confusing, since they
are not in the same relation as "Cothread" with "Thread" (compatible super set)
and the "Co" won't stand for anything in these cases. Naming them as "MutexExt"
or "ExtMutex" sounds a bit cumbersome.