VSadov / NonBlocking

Implementation of a lock-free dictionary on .Net.
MIT License
488 stars 34 forks source link

CoreCLR Friendly? #1

Closed bchavez closed 8 years ago

bchavez commented 8 years ago

Hi,

First off, you have a really cool code here. :+1: It was an interesting exploration looking at the code.

I'm looking to use your NonBlocking collection in some connection pooling code for my RethinkDb.Driver database driver.

I was able to import most of the code but the following Delegate.CreateDelegate isn't available in CoreCLR:

https://github.com/VSadov/NonBlocking/blob/master/src/NonBlockingDictionary/ConcurrentDictionary/DictionaryImpl%602.cs#L24

var del = (Func<ConcurrentDictionary<TKey, TValue>, int, DictionaryImpl<TKey, TValue>>)Delegate.CreateDelegate(
     typeof(Func<ConcurrentDictionary<TKey, TValue>, int, DictionaryImpl<TKey, TValue>>),
     method);

Again, great work here. :+1:

Thanks, Brian

VSadov commented 8 years ago

Supporting CoreCLR is "on todo list". There are many ways this part of the factory can be implemented. Usage of API unavailable on CoreCLR is just because I did not think to check.