A quick look at the code shows that the threads are created so that they
can sleep on an ioctl to the virtual consoles, with one thread for each
(possible) virtual console which waits for the VC to become active.  The
threads were probably created so that the application could be released
without requiring a patch to the kernel.  Note that this application
does not need 60 threads on Solaris, which provides asynchronous
notification of VC switching via SIGPOLL.  A similar method could be
achieved with a very small kernel patch to allow VT_WAITACTIVE to return
whenever any VC switch occurs, e.g., by waiting on a magic console
number or adding a new ioctl command which provides that behavior.  In
fact the kernel already wakes everybody up whenever a VC switch occurs,
it just puts them back to sleep unless they are waiting on the specific
vc that was requested- which is why there has to be one requesting
thread for each possible vc.  So it would be a very minor change but it
would be a kernel change.

-- 
console-kit-deamon spawns too many threads
https://bugs.launchpad.net/bugs/148454
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to