0

I have a multi-process project, and I use the domain sockets as the IPC method.

For example, the process A has the multiple threads and they calls 'write' function to send the data to the process B. (All the domain socket functions are protected by the semaphore.) When the system gets busy, one thread are blocked in the 'write' and it does not released at all. I checked the process B and there is no problem, it still call 'select' and 'read' functions with few time losses. (At least 10ms, according the tick.)

Is there any cases that 'write' function in the domain socket blocks except that the receiver does not read the data? I checked that there is no problem in the process B - receiving part at all. It worked without any blocking situation. The number of threads that calls 'write' are about 5~6, and they call 'write' quite frequently. (Somecases, 100~200 times per 1 seconds.)

My project is MIPS-based embedded linux system. The toolchain uses the uclibc so it may be different with the PC-based linux system.

  • Do you have any nested semaphore accesses that could lead to deadlock? – skrrgwasme Jun 28 '16 at 23:23
  • Because the system is multi-threaded, there are semaphores to protect the critical sections. The problem is that the thread does not return from 'write' function about 3~4 minites. The receiving server part works without any deadlock. – Ghidora Jun 30 '16 at 04:00
  • log("write start..."); write(....); log("write end..."); -> There is a case that "write start..." is logged and then the log "write end..." is not written. – Ghidora Jun 30 '16 at 04:03

0 Answers0