dynamic library suffix"
Do not be too strict about platforms when choosing the shared library
suffix. Assume ."dylib" for MacOS and ".so" for everything else, since
we there is no Windows support at the moment.
In the bounded rate (--rate) mode, if the queue is empty, sleep for a
certain amount of time depending on the requested rate and the number of
worker threads instead of spinning on the queue.
Clean up some code duplication by removing sb_next_event().
A recurring reason for errors is forgetting to run the prepare
step before running the file io test.
Write a warning line suggesting to run prepare.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
The type of MYSQL_BIND::is_null has been changed from my_bool* to bool*
in MySQL 8.0. Since the size bool is not defined by the standard, we
either need to change the DB and Lua APIs to ensure is_null points to a
large enough buffer for MySQL API to store a bool, or do conversions
between sysbench and MySQL data structures. For now, just assert that
sizeof(bool) == 1, which is likely the case on all supported platforms.
Fix --mutex-loops description to say it's the number of empty loops
outside the lock. Also, make the loops really empty by using a compiler
barrier instead of incrementing a local variable.
Optimize the memory benchmark:
- get rid of the global mutex to calculate statistics
- remove if() and switch() branches on critical code paths
- align memory blocks to OS page size
- use native machine word size instead of 'int'
When the deprecated --num-threads option was used in OLTP prepare, the
sysbench.opt.threads variable exported to Lua scripts contained the
default value of 1, even though the actual number of threads created by
sysbench was higher. Which led to unexpected fireworks.
Now the deprecated options override the correspond sysbench.opt.*
variables when used.
Provide compatibility wrappers for system (i.e. distribution-provided)
ConcurrencyKit on i386. Unlike bundled ConcurrencyKit, older versions
that may be provided by distributions do not support CK_USE_CC_BUILTINS,
which makes implementing 64-bit atomics impossible on x86 (32-bit).
Detect if 64-bit atomics are not provided at compile stage and if so,
resort to GCC builtin implementations.
Avoid Lua string management in OLTP_RW by introducing a new sql_param
method: set_rand_str(). Which calls sb_rand_str() in C code with a given
template string and a pre-allocated result buffer. In oltp_common.lua,
use set_rand_str() instead of allocating a new Lua string each time we
need a random string parameter for a prepared statement.