Posted: Mon, 02 Nov 2009 00:44:14 +0000
From: Ozz Nixon member since Jun 12 2009, has contibuted 79 messages.
Thank you for pointing that out --- I will implement the change as you have pointed out to make things "nicer". I will try to schedule some time this week to actually research what is the "best" way to wait for the notification. That code was literally something I did while reviewing the kernel code... and my test was short and sweet - does it work. (didn't check to make sure it was friendly).
Thanks again for pointing this mistake out.
Ozz
Posted: Wed, 23 Sep 2009 18:54:43 +0000
From: håkan elmqvist member since Sep 23 2009, has contibuted 1 messages.
I implemented your inotify.pp and your test program. Works very well, thankyou.
There is, however, a little snag. Running the testprogram I get the following from top:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME_amp_#043; COMMAND
4916 root 20 0 556 392 164 R 98.3 0.0 6:27.96 tinotify
4142 root 20 0 229m 20m 10m R 1.1 2.1 0:02.40 gnome-terminal
3081 root 20 0 329m 182m 2964 S 0.5 18.1
i.e. tinotify uses 98% of the cpu. Putting in a fpsleep(1) in the inner loop (while (message_size=0) do....) relieves the situation. Does it have any side effects besides slowing down detection a bit?
Thanks for any advice in advance
Håkan