Closed bethebest0622 closed 1 year ago
Hey @bethebest0622, this is an admirable effort, but unfortunately I don't have the time to review this nor is this the right place for such a review. I should suggest you reach out to https://softwareengineering.stackexchange.com instead.
I read your code, it's really masterpiece.
but could you have a look at my design, it's naive and for a very simple purpose:
multi-producer multi-consumer shared memory, and avoid CPU busy-waiting (so use a conditional_variable)
I have a header with
conditional_variable
andpthread_mutex_t
. will create when shared_memory are allocated.I also have a shm_worker which used to init and allocate memory. the only thing it do is to init, create or connect to existed.
the producer code is:
the consumer code is:
but, when i call
sender.Send()
, therecver.Recv()
not response.seems conditional_variable
notify_all
didn't wake up Recver process'swait
could you help on this?
and it would be great if you can kindly give some advice about this design.