3 ms·
Also, make sure #1 is done atomically. Your request will either get in a queue, wait for a mutex, or create many more of #2 than needed because the pool isn't s
by marcosdumay 10y ago
Also, make sure #1 is done atomically. Your request will either get in a queue, wait for a mutex, or create many more of #2 than needed because the pool isn't shared between threads.
- valarauca1 10y agoRust uses jemalloc which has per-thread-pooling (sort of). There is very little lock contention as there are multiple pools per-thread. Also per thread pooling doesn't use more memory then not. In some cases it actually uses less. Citation: https://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemalloc.pdf https://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemal...