Originally posted by: SystemAdmin
We have a C++ program trying to read the contents of psinfo files from ALL the directories in the following dir: /proc
As you might already know, this dir is used by kernel to maintain info about ALL the processes running on the machine.
Most of the time, read() on any of the psinfo files under /proc/<pid> works just fine.
But sometimes it blocks for a really long time like in 10s of minutes (I think it blocks forever).
When it blocks, if we try to do lsof on the file, the following is the output
-
lsof /proc/21156016/psinfo
lsof: WARNING -- child process 21012506 may be hung.
lsof: status error on /proc/21156016/psinfo: Connection timed out
Looked at the available documentation online and nothing in the documentation suggests that read() on psinfo file should block for a long time.
If the kernel is writing the file, read() may block temporarily. (I am speculating on that documentation doesnt say it)
Could you please throw some light on this issue? Appreciate your help.
We noticed this behavior only on Multi-processor box. Tests on single processor AIX box didnt have such a problem. Just wanted to point that out, if the box being Multi-Processor box has anything to do with the problem.
#AIX-Forum