greenify
greenify copied to clipboard
Support for C++ conditional variables
Threaded libmc clients maintain consistent cache response times by queueing requests to acquire a mutex from the client pool. In order for this to work, threads releasing the client have to notify the waiting threads that a client is now available. This is done through a C++ condition_variable
on the stack to avoid heap allocation. The problem right now is that greenlets swap the stacks in memory, meaning that any stack pointer from another thread is no longer valid as it now points to the notifying stack. In contrast, C++ uses virtual address spaces to separate the threads' stack addresses.
[update: still pending as of 2024-03-03; backlogged]