Simple question about blocking read() calls

Hi people, I’m new to the Net+OS Stuff and just another stupid question came up. I’m currently working on a Serial Receiver Thread which should just read data from the serial, process them and pass them over to another thread. while(1) { read(desc, &buf, ByteCnt); /further processing/ } is basically the approach I came up with, but then I struggled with the following: If the thread runs like that it’ll run infinitely and won’t allow Threads with lower priority to run, right ? Then I remembered that read is blocking unless the Serial Interface is configured not to do so (which I didn’t do), but what does that mean to my thread if read blocks ? Does it get suspended then ? Generally, would there be a better way to implement that with the NetOS Api ? Sincerly, Steve

Blocking means that the thread is suspended. This the the nice way to have threads behave in multithreaded applications. The method will block ( suspend ) the thread until data becomes available. At this point the thread will be allowed to run again. When it will run depends on ThreadX and what your other threads are doing at the time