Each system call is thread independent. Thus, since you are not using process core data, both will work independently of each other without disturbing each other.
Another thing that the kernel does is with system calls associated with the same inode (in this case, the virtual node assigned to the socket that you use for communication). To serialize and create atomic calls to the file system, the kernel usually performs an inode lock during the entire system call (this is a system call for reading, writing, or ioctl), which indicates the entire system call (even if you make a unique write call for writing in a million bytes, inode is blocked during the execution of the entire system call)
In the tcp-ip stack, this is done at the socket level and is controlled in your case by special software of the socket class AF_INET . Like udp, sending a packet or receiving does not affect the shared resources that you need to block, but you will have to look at your udp implementation (or socket level) to see if any blocking has been completed, and what is the granularity, Usually a blocking it should be used only during loading / unloading of udp buffers (as a rule, in udp there are no buffers, since the socket and network card driver are sufficient to provide enough buffer resources.
source share