Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#9285 closed Bugs (fixed)

CreateMutex return NULL if failed

Reported by: huyuguang@… 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).

Attachments (0)

Change History (5)

comment:1 Changed 4 years ago by Ion Gaztañaga

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.

comment:2 Changed 4 years ago by Ion Gaztañaga

Resolution: fixed
Status: newclosed

(In [86476]) Fixes #9285

comment:3 in reply to:  1 Changed 4 years ago by huyuguang@…

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

#if defined(_WIN32)
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.

comment:4 Changed 4 years ago by Ion Gaztañaga

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 in reply to:  4 Changed 4 years ago by anonymous

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ion Gaztañaga.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.