FreePascal Information Logo Friend of FreePascal Compiler Title
Articles with Feedback, FPC News Library, PDF Collection, Mail Lists, Books, Newsgroups, IRC Open online discussion areas Research and Tutorials Tools, Compilers and Utilities Blurbs about us, advertising, etc.
Welcome to the FoFPC Message Board, Linux OSProgramming , inotify draws cpu power

You may not copy or reproduce any of these message boards without written permission from both the author and 3F, LLC. All messages are (c) 2009 by 3F, LLC. All rights reserved, worldwide.

Previous Message(s) Previous Message(s) Help Reload this area
inotify draws cpu power
Login Credentials
Email Address: 
Password: 
To Sign-Up Answer BOTH columns of fields
Email Verify: 
Password Verify: 
First Name: 
Last Name: 


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

 Links and Products we find useful



ButtonGenerator.com
Valid XHTML 1.0 Transitional Internet Map
Programmer's Heaven
grat-i-fi-ca-tion - noun
the state of being gratified; great satisfaction.


"Wow! We are so pleased to see Friends of FreePascal Compiler ... with such a cool look and feel!"

"We like the fact you wrote all of the server scripts using FPC!"

Ian Wright
Codemasters
Locations of visitors to this page world map hits counter
Copyright 2009 by 3F, LLC. All rights reserved. Worldwide.
Your request was processed by server #2 in 0.021490 secs.

sponsor
This sponsor helps us with our documentation