idle task check

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Thu Jun 4 17:53:38 EDT 2015


On Thu, 04 Jun 2015 15:16:24 +0200, Mustafa Hussain said:

> I mean how can we use the pid in the scenario of finding the process that
> is not used.

What, *exactly*, do you mean by "not used"?  And what do you plan to do with
a process that's running but "not used"? (Hint - think about *why* it's running
if it's not in use...)

The fact that a user has not direct interacted with a process doesn't mean they
are not in fact using it.  Banshee and pulseaudio can be streaming music even
though I haven't touched the banshee gui in hours, and I can't interact
directly with pulsaudio at all because it presents no user interface.
Similarly, your X server is probably "in use", and a lot of other background
processes doing things for the user.

And if your code does something to my pidgin process because it's doing
background housekeeping even though I'm not "using" it, I'm going to be quite
upset if it results in me not getting an IM from my boss that a meeting has
been rescheduled...

Now, things like Chrome can deactivate tabs, but only because it has additional
information only available in userspace:  That the process is associated with a
tab, that a tab has certain semantics when not visible, and that the tab is or
isn't visible to the user.  And you *still* have to provide a user control
because some tabs can't be suspended because they have Javascript attached that
have to do housekeeping functions like sending keepalive packets to a webserver
to maintain a connection even if you're not looking at the tab.




More information about the Kernelnewbies mailing list