Remove unnecessary memory barrier

The memory barrier is not needed here. Declaring poll_msg as volatile
should help with preveting some unwanted optimizations. Most likely
even that is unnecessary.

This came up when testing maxadmin "show servers", which is
surprisingly slow compared to the other commands. This change does
not help because the slowness is caused by the polling loop sleeping.
In a more busy environment the command would probably complete faster.
This should be looked at later.
This commit is contained in:
Esa Korhonen
2016-12-14 14:06:44 +02:00
parent f59c6d67c3
commit 3a96482c23

View File

@ -104,7 +104,7 @@ static int do_shutdown = 0; /*< Flag the shutdown of the poll subsystem */
static GWBITMASK poll_mask;
/** Poll cross-thread messaging variables */
static int *poll_msg;
static volatile int *poll_msg;
static void *poll_msg_data = NULL;
static SPINLOCK poll_msg_lock = SPINLOCK_INIT;
@ -1767,11 +1767,6 @@ void poll_send_message(enum poll_message msg, void *data)
for (int i = 0; i < nthr; i++)
{
if (i != thread_id)
{
/** Synchronize writes to poll_msg */
atomic_synchronize();
}
poll_msg[i] |= msg;
}