CoreyKaylor / Lightning.NET

.NET library for LMDB key-value store
Other
398 stars 82 forks source link

put fails when called from inside a Parallel.For loop #107

Closed undecided2013 closed 4 years ago

undecided2013 commented 6 years ago

App crashes out when the put is called from inside Parallel.For(0, 100000000, (i) => { tx.Put(db, BitConverter.GetBytes(i), BitConverter.GetBytes(i), PutOptions.None); }

I was trying some perf tests and I wanted to utilize many cores. I used the code in ProfilingTests.cs. Modified DoStuffHelper method.

CoreyKaylor commented 4 years ago

This is not supported in the underlying lmdb native library so therefore I won't be supporting it here. If you need parallelization, you'll need a unique transaction per thread.