greenify icon indicating copy to clipboard operation
greenify copied to clipboard

Support for C++ conditional variables

Open kentslaney opened this issue 1 year ago • 0 comments

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]

kentslaney avatar Feb 07 '24 04:02 kentslaney