4 ms·
Sounds like you are trying to re-invent Software Transactional Memory - was a nice idea 10 years ago, but after lots of research it is still not available in co
by the_why_of_y 10y ago
Sounds like you are trying to re-invent Software Transactional Memory - was a nice idea 10 years ago, but after lots of research it is still not available in common runtimes...
Some more problems to consider:
1. how do you roll back IO that happens in a critical section?
2. your global semaphore will be highly contended and basically destroy scalability
- datenwolf 10y agore 1) good point, didn't think of that re 2) the fork global lock satisfies every requirement for a multiple-readers/single-writer, with fork() being the only writer. Unless the program does a lot of fork()-ing it should hardly ever run into contention. The moment fork() waits on the lock, further attempts on read-lock are delayed until after fork() completes and the existing reads are waited for, before fork()-ing.