mariadb/include
Davi Arnaut 28f29b7313 Bug#38941: fast mutexes in MySQL 5.1 have mutex contention when calling random()
The problem is that MySQL's 'fast' mutex implementation uses the
random() routine to determine the spin delay. Unfortunately, the
routine interface is not thead-safe and some implementations (eg:
glibc) might use a internal lock to protect the RNG state, causing
excessive locking contention if lots of threads are spinning on
a MySQL's 'fast' mutex. The code was also misusing the value
of the RAND_MAX macro, this macro represents the largest value
that can be returned from the rand() function, not random().

The solution is to use the quite simple Park-Miller random number
generator. The initial seed is set to 1 because the previously used
generator wasn't being seeded -- the initial seed is 1 if srandom()
is not called.

Futhermore, the 'fast' mutex implementation has several shortcomings
and provides no measurable performance benefit. Therefore, its use is
not recommended unless it provides directly measurable results.
2008-10-15 19:21:00 -03:00
..
atomic Bug#33728 Atomic builtins 2008-01-11 20:34:36 -02:00
mysql WL#4380 2008-06-17 17:57:04 +05:30
.cvsignore
base64.h Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
config-netware.h Many files: 2007-07-23 23:54:55 +02:00
config-win.h Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main 2008-03-28 12:14:27 +02:00
decimal.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
errmsg.h Bug#27430 "Crash in subquery code when in PS and table DDL changed after 2008-05-20 20:36:26 +04:00
ft_global.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
hash.h Bug#37958 - test main.plugin crash on Mac OS X when selecting from EXAMPLE engine. 2008-10-01 12:21:15 +02:00
heap.h Added support for 'internal temporary tables' in HEAP tables. 2007-07-25 01:58:12 +03:00
help_end.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
help_start.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
keycache.h Backport of the keycache changes from http://lists.mysql.com/commits/31517 to make keycache 64-bit safe in 5.0. This is for bug #5731. 2007-08-29 20:45:04 +04:00
m_ctype.h BUG#31168: @@hostname does not replicate 2008-03-07 13:59:36 +01:00
m_string.h Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main 2008-02-08 12:13:33 +01:00
Makefile.am WL#4380 2008-07-18 19:21:54 +05:30
my_aes.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
my_alarm.h Many files: 2006-12-23 20:17:15 +01:00
my_alloc.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_atomic.h Fixes to merge between 5.1-main and 5.1-marvel 2007-10-15 18:22:19 +03:00
my_attribute.h Bug#25118 ATTRIBUTE_FORMAT_FPTR undeclared in m_ctype.h 2007-04-12 00:43:25 +02:00
my_base.h Fixed problem with non-synchronous error lists 2008-03-28 18:45:03 +02:00
my_bit.h Fixes to merge between 5.1-main and 5.1-marvel 2007-10-15 18:22:19 +03:00
my_bitmap.h Bug#31552 Replication breaks when deleting rows from out-of-sync table 2007-12-12 12:14:59 +02:00
my_dbug.h Bug#26243 mysql command line crash after control-c 2008-03-28 14:02:27 -04:00
my_dir.h Many files: 2006-12-23 20:17:15 +01:00
my_getopt.h Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name> 2008-02-18 23:29:39 +01:00
my_global.h Correct failing build. 2008-04-28 14:58:32 -04:00
my_handler.h Fixed problem with non-synchronous error lists 2008-03-28 18:45:03 +02:00
my_libwrap.h Many files: 2006-12-23 20:17:15 +01:00
my_list.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_md5.h Avoid the name conflict between the system-provided "md5.h" and the MySQL one 2007-07-19 14:14:03 +02:00
my_net.h Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
my_no_pthread.h Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
my_nosys.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_pthread.h Bug#38941: fast mutexes in MySQL 5.1 have mutex contention when calling random() 2008-10-15 19:21:00 -03:00
my_stacktrace.h Bug#37003 Tests sporadically crashes with embedded server 2008-06-19 11:02:32 -03:00
my_sys.h merging 2008-08-23 07:47:43 +05:00
my_time.h Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug26294/my50-bug26294 2008-04-03 13:14:57 -04:00
my_tree.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_trie.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_uctype.h Many files: 2006-12-31 02:29:11 +01:00
my_user.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_vle.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_xml.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
myisam.h merging 2008-08-23 07:47:43 +05:00
myisammrg.h Fixed bug#36006: Optimizer does table scan for SELECT COUNT(*) 2008-04-26 02:45:58 +05:00
myisampack.h Many files: 2006-12-23 20:17:15 +01:00
mysql.h Merge mysql.com:/Users/davi/mysql/bugs/29592-5.0 2007-11-26 16:10:26 -02:00
mysql.h.pp WL#4380 2008-08-08 14:30:05 +05:30
mysql_com.h Bug#27430 "Crash in subquery code when in PS and table DDL changed after 2008-05-20 20:36:26 +04:00
mysql_embed.h Bug #32211 Test 'windows' and 'windows_shm' failed for embedded server 2007-11-18 00:32:06 +04:00
mysql_time.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
mysql_version.h.in Bug #15327: configure: --with-tcp-port option being partially ignored 2007-09-13 16:19:46 +02:00
mysys_err.h WL#2936 2007-03-02 08:43:45 -08:00
queues.h Bug #31890 Partitions: ORDER BY DESC in InnoDB not working. 2007-11-14 22:20:31 +04:00
rijndael.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sha1.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_common.h Merge mysql.com:/home/hf/work/25097/my50-25097 2008-02-27 13:00:59 +04:00
sslopt-case.h Many files: 2006-12-23 20:17:15 +01:00
sslopt-longopts.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
sslopt-vars.h Many files: 2006-12-23 20:17:15 +01:00
t_ctype.h Many files: 2006-12-23 20:17:15 +01:00
thr_alarm.h fixes for build failures due to my yesterday's changeset forbidding 2008-02-19 18:45:11 +01:00
thr_lock.h Bug#34306: Can't make copy of log tables when server binary log is enabled 2008-09-29 10:53:40 -03:00
typelib.h Merge bk-internal.mysql.com:/home/bk/mysql-5.1-engines 2007-04-27 19:09:39 +02:00
violite.h Merge quadxeon:m/srv/quadxeon/local/bk/maint/jun14/50 2007-06-15 19:06:06 +02:00