the-moisrex / webpp

C++ web framework | web development can be done with C++ as well.
https://t.me/webpp
MIT License
134 stars 9 forks source link

Generator Pool #561

Open the-moisrex opened 2 months ago

the-moisrex commented 2 months ago
template <Generator GenT, std::size_t PoolSize = 10, Locker LockT = std::conditional_t<PoolSize == 1, noop_locker, unique_lock>>
struct generator_pool;
the-moisrex commented 2 months ago

GenT can has its own data-race protection mechanisms like atomic<int>; so the locking system needs to be smarter.