Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4, 11.5(EOL)
Description
The sharded shared counter template ib_counter_t uses the function my_timer_cycles() as a source of pseudo-random numbers. On some platforms, my_timer_cycles() could return the constant value of 0. The function get_rnd_value() would work around this at run time (while it should have been done at compilation time) and invoke the function pthread_self() if the returned value happened to be 0.
To fix this, let us define a wrapper my_pseudo_random() that is either an alias of my_timer_cycles() or a wrapper for pthread_self(). In practice, the wrapper should only come into play on exotic operating systems or instruction set architectures.
Attachments
Issue Links
- relates to
-
MDEV-21212 buf_page_get_gen -> buf_pool->stat.n_page_gets++ is a cpu waste (0.5-1%)
- Closed
-
MDEV-34296 extern thread_local is a CPU waste
- Closed