| 26 | static constexpr uint64_t N = 10000; |
| 27 | |
| 28 | void do_test(int pool_mode, const PhotonOptions& options) { |
| 29 | init(INIT_EVENT_DEFAULT, INIT_IO_NONE, options); |
| 30 | WorkPool pool(4, INIT_EVENT_DEFAULT, INIT_IO_NONE, pool_mode); |
| 31 | semaphore sem(0); |
| 32 | auto start = now; |
| 33 | for (uint64_t i = 0; i < N; i++) { |
| 34 | pool.async_call(new auto([&] { sem.signal(1); })); |
| 35 | } |
| 36 | sem.wait(N); |
| 37 | LOG_TEMP("Spent ` us", now - start); |
| 38 | fini(); |
| 39 | } |
| 40 | /* |
| 41 | TEST(Normal, NoPool) { |
| 42 | do_test(0, {}); |