Closed buybackoff closed 9 years ago
We used DllImport at a previous point.
Matt had issues with this style of interop on Linux/Mono/x64, though, which was surprisingly alleviated for him by changing to delegate interop. I believe there's a closed issue which has more details, but IIRC it stems from some marshalling-unfriendly string handling in the native nanomsg library.
I measured a small performance differential in local pubsub concurrency testing when the delegate interop was introduced. The SO article you link to makes it seem a bit more of a disaster than it is in practice.
If it can be done in a way which doesn't reintroduce platform-specific issues we could easily resurrect DllImport interop. Care to help?
Thank you for your detailed response! I do not think that in IO-bound work that matters too much and good to know that you tested it and it is not that bad. I was somewhat confused while reading the code, though.
A question partially based on your code and an answer from a guru http://stackoverflow.com/questions/27981719/c-sharp-native-interop-why-most-libraries-use-loadlibrary-and-delegates-instea/