Hello,
Sorry for the late reply. I want to establish continuous contact with all the attached devices. RedX is right that i should check it in while loop. I have already established connections but individually to the boards and checked the data communication using while loop.
The application brief is:
1.Serial port 1 is attached with one circuit PIC controller board.
2.Serial port 2 is attached with another circuit of 8051 controller board.
3.WIFI adapter is connected to the USB for wireless transmissions.
Now, i want to continuous monitor signals from all above boards/ wifi (in loop) and also send them instructions.
this should happen simultaneously for all of them.
So, i was thinking to implement respective threads so as one port should not stuck because of other port operations.
1. Can i implement mentioned scenario through Threads?
2. Yes, then how?
You could use threads. How is more time then i have at hand.
Take a look at pthreads. It a threading library. From the examples you should have an idea of what you have to do. You must also make sure that the write operations that you will be using are thread-safe or else you won't have any advantage on multi-threading.
I'd preferr, as i mentioned, open the sockets in NON BLOCKING mode and use that in a loop.