#9285 closed Bugs (fixed)
CreateMutex return NULL if failed
Reported by: | Owned by: | Ion Gaztañaga | |
---|---|---|---|
Milestone: | To Be Determined | Component: | interprocess |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
winapi_mutex_wrapper.hpp line 149
The invalid handle for mutex is NULL(0), not winapi::invalid_handle_value(-1).
Change History (5)
follow-up: 3 comment:1 by , 9 years ago
comment:3 by , 9 years ago
Replying to igaztanaga:
Thanks for the report. It will changed to handle a nullptr. winapi_mutex_wrapper also shares the same bug described in your #9288 ("timed_wait does not check if has expired") ticket.
I suggest you remove the #define BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION in workaround.hpp
defined(WIN32) | defined(WIN32) |
#define BOOST_INTERPROCESS_WINDOWS #define BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION #define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
If a server need to handle multiple message queue, for example, 64 queues, the spinlock would kill too much cpu. Also, if possible, I hope you can implement two more function which are multi_timed_recv and multi_timed_send, so that I can wait multiple queue and do not need to lanuch many threads for every queues.
follow-up: 5 comment:4 by , 9 years ago
Native synchronization primitives are experimental so they are not enabled by default. spinlock handling will be improved in Boost 1.55 so CPU usage will be pretty low.
comment:5 by , 9 years ago
Replying to igaztanaga:
Native synchronization primitives are experimental so they are not enabled by default. spinlock handling will be improved in Boost 1.55 so CPU usage will be pretty low.
I just checked the latest code boost 1.55 beta, now the spinlock use _mm_pause. Maybe it will be better, but I really really want you implement a actor based message queue. I hope I can write the code as async_recv(queue, buffer_ptr, [buffer_ptr](size_t cb) {}), and I can handle multiple queues's recv and send in one thread.
Thanks for the report. It will changed to handle a nullptr. winapi_mutex_wrapper also shares the same bug described in your #9288 ("timed_wait does not check if has expired") ticket.