Cost of notifying a condition variable
| 856 | |
| 857 | // Cost of notifying a condition variable |
| 858 | double notify_all() { |
| 859 | int count = 1000000; |
| 860 | std::condition_variable cond; |
| 861 | |
| 862 | uint64_t start = Cycles::rdtsc(); |
| 863 | for (int i = 0; i < count; ++i) { |
| 864 | cond.notify_all(); |
| 865 | } |
| 866 | uint64_t stop = Cycles::rdtsc(); |
| 867 | |
| 868 | return Cycles::toSeconds(stop - start)/count; |
| 869 | } |
| 870 | |
| 871 | double notify_one() { |
| 872 | int count = 1000000; |