3 related design questions: UDP fds, tasks, and select.
Posted: Tue May 03, 2011 8:35 am
I have a host NB that talks to some other NB platforms that locally collect, parse and log sensor data. Upon UDP request from the host, the sensor NBs transmit processed data for approx three different sensors to the host via UDP over one or more fds created with CreateTxRxSocket(). Each of the three sensors, reads, parses and logs data in independent tasks. The data for each sensor is stored in OSCriticalSection protected structs. Here are my first two questions:
On the sensor end, does it make better sense to have one task listening for requests for sensor data over one fd, or three tasks listening for requests that are sensor specific on three fds?
On the host end, the data for the different sensors is needed asyncronously in different tasks. Once again, any thoughts of whether it makes better sense to have one or three fds?
I'm leaning towards multiple fds, but is there a downside in too many fds? I think the host will have about a dozen fds to different sensors this way, along with the typical web, ftp, and 3-4 serial port fds.
Here's my last question. What will provide better throughput: One task that uses a select statement to handle multiple fds, or several tasks that each use a select statement to process a single fd?
On the sensor end, does it make better sense to have one task listening for requests for sensor data over one fd, or three tasks listening for requests that are sensor specific on three fds?
On the host end, the data for the different sensors is needed asyncronously in different tasks. Once again, any thoughts of whether it makes better sense to have one or three fds?
I'm leaning towards multiple fds, but is there a downside in too many fds? I think the host will have about a dozen fds to different sensors this way, along with the typical web, ftp, and 3-4 serial port fds.
Here's my last question. What will provide better throughput: One task that uses a select statement to handle multiple fds, or several tasks that each use a select statement to process a single fd?