139 karma · joined May 15, 2011
But to answer your question: no, it's not inetd. Inetd is very inefficient in terms of CPU and memory usage and has scalability issues thanks to the fact that it spawns a new process for every client. Systemd does not do that: it waits until someone connects to the socket, then starts the service and have the service handle all clients on the socket. Systemd then waits until the service has exited. The service can use I/O events or threads or whatever efficient mechanism to handle multiple clients on the server socket, all within a single process.
This in itself does not require Linux-specific features. However the GNOME discussion is about depending on systemd which happens to be Linux-specific at the time for other reasons, not about GNOME wanting to be Linux-only (which is sensationalist headline). One of the reasons systemd is Linux-only is because it uses cgroups, which I explained here: http://news.ycombinator.com/item?id=2565801
Is there anything wrong with lazy? Remember that people have limited time and man power.
There's a very good reason for using cgroups: to completely clean up a service's process tree even in the face of abusive behavior. A service can spawn a child process that calls setsid(). By using cgroups systemd can kill that child process too. Traditional POSIX APIs like killpg() do not allow that and give processes the ability to escape supervision.
You say FreeBSD's kernel APIs are superior. It makes me wonder why you think that. There are only two things that I think are better on FreeBSD than on Linux: kqueue is better than epoll, and the OpenBSD firewall is easier to learn than iptables. As for everything else I've yet to see hard evidence that FreeBSD beats Linux.
- Many traditional init systems are based on a bunch of shell scripts with some metadata. Each service is started through a shell script that supports the start/stop/restart argument. While this makes the implementation very simple, it also makes it inefficient. To start a service the init system must create a new process (the shell script) which in turn invokes a bunch more processes (because almost anything you do in a shell script requires external commands) before finally invoking the service itself. This is expensive in terms of both CPU usage and disk I/O, and the latter really matters for boot time. Systemd accepts a bunch of service description files and handles the starting and stopping for you.
- Traditional init systems are about starting and stopping services. Systemd is also about keeping services running. For example if a daemon crashes, with most init systems you have to restart it manually or hook it to some external monitoring system. External monitoring systems usually rely on polling to check whether services are still alive. Systemd on the other hand just forks() the service, waitpids() on it, and gets notified by the kernel when the services crashes. No polling involved. Polling wastes CPU and reduces battery life. Polling also makes leaves a small time gap during which the service is temporarily dead but hasn't been restarted yet. This latter can be mitigated with a smaller polling interval but the smaller this interval the more CPU you use.
- Systemd supports on-demand starting of services. It starts a service as soon as a program needs it. This works by having systemd allocating server sockets and listening on them. When a client connects to a server socket, systemd will not accept() the client; instead systemd will figure out which service it belongs to, then starts that service, passing it the server socket. The service then accept()s the client. This is great for saving CPU, memory and disk I/O until it's really necessary. It saves battery life and reduces boot time. EDIT: It's not (x)inetd, see my reply.
Unfortunately most people slam GNOME and systemd for being NIH or crazy without understanding the reasons. I hope this post makes some people understand the rationale behind systemd.
Glib goes into great lengths to avoid namespace conflicts so it defines the GBoolean type and G_TRUE/G_FALSE. Whether that really is better than #define TRUE/FALSE, I don't know.
You treat "repaint" as if it's a single thing that's either faster in all cases or slower in all cases. Browser rendering is a very complex thing and some pages render faster in one browser while other pages render faster in another.