> That means that the ranges should be different for every thread. I tried to
> simulate that by
>     params[i] = sb_rand(thread_id, oltp_table_size)
> 
> Maybe there is a better way to handle this?
> 

Yes, I think there should be a better way.

Given that the number of threads is typically much lower than oltp_table_size, 
there will be a significant overlap in produced ranges for random values, i.e. 
they won't be that different.

To prevent overlapping (i.e. make them really different) you need to partition 
the whole table into num_threads segments and then make each thread work with 
its own segment. That is, something like:

params[i] = sb_rand(oltp_table_size / num_threads * thread_id, oltp_table_size 
/ num_threads * (thread_id + 1)).

Does this make sense?
-- 
https://code.launchpad.net/~hakan-askmonty/sysbench/hakan/+merge/39548
Your team sysbench-developers is subscribed to branch lp:sysbench.

_______________________________________________
Mailing list: https://launchpad.net/~sysbench-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sysbench-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to