libCanOpenSimple icon indicating copy to clipboard operation
libCanOpenSimple copied to clipboard

asyncprocess busy waits

Open felixcollins opened this issue 1 year ago • 4 comments

Currently async process busy waits consuming an entire cpu core. I suggest using a ManualResetEvent and signalling the asyncprocess thread from all the methods that could cause it to do work. I've forked your project to use it with SocketCANSharp. I'll be making this change in my fork but I've also refactored a lot so it may be that you want to back port a few changes rather than trying to merge the fork back. Up to you, this is just a heads up really.

felixcollins avatar Sep 15 '24 23:09 felixcollins

I ended up using AutoResetEvent.

felixcollins avatar Sep 16 '24 23:09 felixcollins

Thanks for the heads up. I'll have a look into this and refactor it somewhat.

robincornelius avatar Sep 17 '24 08:09 robincornelius

I made quite a few other changes. Feel free to ask questions. I appreciate your work as I was not familiar with can open. If I use my fork of your lib in our production code it will be going to the ISS!

felixcollins avatar Sep 17 '24 09:09 felixcollins

I'll have a look at pulling in your changes. They look very useful. ISS very cool.

robincornelius avatar Sep 18 '24 10:09 robincornelius