4 ms·
Isn't the case with something like signals is that it needs to simply be left as is and instead a new API for interprocess communication be developed alongside?
by bombcar 6y ago
Isn't the case with something like signals is that it needs to simply be left as is and instead a new API for interprocess communication be developed alongside?
It seems pretty clear that they're used for way more than originally expected (did threads even exist when signals began?) - and I suspect a number of systems use other communication paths already.
- icedchai 6y agoThreads arrived relatively late to Unix, long after signals. I think Solaris 2.x was the first mainstream Unix to have threads.
- usr1106 6y agoAre you talking about kernel threads or user space threads? I believe none of them were really in Unix very early, but the time of introduction varied.
- icedchai 6y agoI was referring to kernel threads.
- usr1106 6y agoI vaguely remember that kernel threads were something new in HP-UX in the end of the 1990s. The question is, was that late? Windows NT had kernel threads from the beginning, so maybe a few years earlier. But then it took NT years to become stable enough to be used in servers, so saying they were generally ahead would not be a correct description. So if Unix is considered late (according to the GGP) and NT not a comparable competitor, who was really early? If anybody.
- User23 6y agoWhat’s really sad is that multi user system interrupts were long since a solved problem when Unix was developed. I don’t know why that existing body of knowledge wasn’t applied.
- pm215 6y agoThe impression I got from reading the v6 kernel code in the Lions book was that signal handling had been added in as a solution to a few specific problems (like "we're going to kill this process but maybe it should get a chance to clean up first"). If you're thinking about them from that viewpoint then the (now) well-known problems like interruption-of-syscalls and the initial "when you take a signal the handler gets unregistered" don't seem like such a big deal -- after all, the process is going to exit anyway.
- linschn 6y agoDo you have a reference on pre-1969 multi user interrupts being solved? Also, Unix was developed on a ~16kB RAM machine IIRC... Maybe that's the reason?
- User23 6y agoSure, here’s Dijkstra on it[1]. The X1[2] was a significantly more limited machine than the PDP-11. I believe that work predates Unix by nearly a decade. [1] https://www.cs.utexas.edu/users/EWD/transcriptions/EWD13xx/EWD1303.html https://www.cs.utexas.edu/users/EWD/transcriptions/EWD13xx/E... [2] https://ub.fnwi.uva.nl/computermuseum//X1.html https://ub.fnwi.uva.nl/computermuseum//X1.html
- linschn 6y agoThanks
- pjmlp 6y agoJust like safer systems programming languages precede C for about 10 years. It is not as if the UNIX culture was to pay attention to best practices being done on other systems.
- Jasper_ 6y agoA proper inter-process communication mechanism that supports multicast has been proposed to the kernel multiple times and denied every time. So it's probably not going to happen.
- cbsmith 6y agoUnix has a plethora of IPC APIs, almost all of which were invented after signals (e.g. sockets). Signals themselves got new APIs long before signalfd: sigaction and posix real-time signals were already a thing, as were posix threads, when Linux was invented.
- astrange 6y agoThere are definitely other problems with signals; for instance you can't fully implement a signal handler in most languages except C, because you can't write async-signal-safe code in them. This is reasonable in a memory-safe language, but means you need some other way to interrupt a read from stdin with ^C.