Closed gghose closed 2 years ago
If I understand you correctly, the problem is not that the port actually takes a long time to open, rather than the serialPortWasOpened
delegate call back takes a long time due to it waiting on other tasks going on on the main thread/queue. Assuming that's the case, the obvious solution is to reduce contention on the main queue, but I realize that's easier said than done. There is an issue for allowing a custom delegate queue to be specified: #35. I've decided not to do that for now, but may revisit in the future.
I have a multi-threaded program with a lot of initialization going on. In a non-main thread I open a serial port, which presumably puts a request on the main thread. The problem it is taking a relatively long time for that request to be made (so presumably there's a lot of NIB initialization that's delaying it).
The specifics are an interval of about 3 seconds between the port open and getting the message serialPortWasOpened. Any way to speed this up?