I would like to know how I can achieve the following in objective-c,
I am doing communication with FTDI232R modem using serial communication,So I am using POSIX call to open,write and read from the path of the modem(dev/tty/nameOfModem). The POSIX calls are synchronous calls so while read I don't want to block my main thread hence I am thinking to do read call in separate thread.
I don't want this secondary thread to run continuously but wake up only when there is something to read and after read is completed it should sleep.I went through the documentation and read about providing an input source to the NSRunLoop and adding that runloop to the secondary thread,but couldn't figure out how to do it.
Thank you in advance for all your help.