icintamyself
MIS
I write a program that which consist of an infinite loop.
Within the loop are codes that suppose to look for new file
that is just being uploaded in a folder. When it detect a new file arrives, it would open the file, read it and do some processing.
It is critical for the file to be quickly loaded into my database when it arrives. Hence I didn't use sleep() in the loop.
With that scenario, when I use the top command (HP-UX), I discovered that my perl program was the highest cpu utilization process 95.69 %. Is there anyway that I could lower down the cpu utilization without using sleep() but at the same time ensure that my program can still be very responsive to the arrival of new file in the folder ?
Thanks in advance.
Within the loop are codes that suppose to look for new file
that is just being uploaded in a folder. When it detect a new file arrives, it would open the file, read it and do some processing.
It is critical for the file to be quickly loaded into my database when it arrives. Hence I didn't use sleep() in the loop.
With that scenario, when I use the top command (HP-UX), I discovered that my perl program was the highest cpu utilization process 95.69 %. Is there anyway that I could lower down the cpu utilization without using sleep() but at the same time ensure that my program can still be very responsive to the arrival of new file in the folder ?
Thanks in advance.