|
|
Subscribe / Log in / New account

Cool new Free software

Cool new Free software

Posted Dec 19, 2012 16:52 UTC (Wed) by nix (subscriber, #2304)
In reply to: Cool new Free software by man_ls
Parent article: Status.net service to phase out, replaced by pump.io

There is no such thing as 'a kernel process' in this sense: a process is not 'frozen' when it's select()ing, it's blocking *in the kernel*. When an event comes, the kernel wakes up and returns to userspace: no 'thawing' is necessary. select() is just a system call that blocks in the kernel, just like, say, read() often does (and just as lots of other syscalls do).

Creating a new process for every single event seems sure to be far more expensive than just a privilege transition out of kernel mode. My system here can manage about five or ten thousand forks per second, but it can manage well over a million context switches into and out of kernel mode per second.

(As for a process being 'based on' a kernel process, the level of your confusion regarding how processes work in Unix is seemingly so great that I can't even imagine what you intend this to mean. Your last line suggests that you expect it to have a whole new address space of its own, which makes the thing a process-creation-level of difficulty rather than a thread-creation-level, and requires among other things a TLB flush. Expensive, expensive...)


to post comments

Cool new Free software

Posted Dec 19, 2012 17:27 UTC (Wed) by man_ls (guest, #15091) [Link] (2 responses)

I was just translating poorly what I imagine that node.js does, to kernel concepts (which for me is admittedly like translating French into Italian). Precisely the idea was to avoid creating a new address space. Instead of having a new address space, just use the kernel's (knowing that the process will not access what it shouldn't).

Cool new Free software

Posted Dec 19, 2012 19:42 UTC (Wed) by nix (subscriber, #2304) [Link] (1 responses)

Yeah. That's exactly what select(), poll(), and other blocking syscalls do now, and have done since Unix was invented (well, OK, they weren't around then, but read() was, and it did just the same).

Cool new Free software

Posted Dec 19, 2012 19:47 UTC (Wed) by man_ls (guest, #15091) [Link]

Way to go then :) Thanks for your patience.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds