News for hackers. Stuff that matters.
Re:How Not to Write a Signal Handler by lkrubner on Thursday November 27, 2014 @05:30PM (#8668962)
They write:

"It is the 2013th year in the Common Era at the moment of this writing and you might think that people should have came up with something better in terms of signal handling at this time. The truth is that they did. It is just not that well known yet due to a huge momentum of outdated information still overflowing the Internet."

Then they talk about kqueue.

The above paragraph emphasizes how much Unix programming still relies on old ideas.

Likewise, sockets are an old idea, and newer libraries, such as ZeroMQ, do a lot to fix the old problems. ZeroMQ is often described as "Sockets on steroids". It implements a lot of patterns that Unix itself does not give us:

"It gives you sockets that carry atomic messages across various transports like in-process, inter-process, TCP, and multicast. You can connect sockets N-to-N with patterns like fan-out, pub-sub, task distribution, and request-reply. "

But I am left wondering, what would the world of programming be like if we had a new operating system that incorporated some of the new ideas and patterns that have developed over the last 25 years? Instead of depending on libraries, would we not be better off if we had an OS built around these newer ideas?

Re:How Not to Write a Signal Handler by lmm on Friday November 28, 2014 @04:18AM (#8670243)
It's been tried. Look at plan 9, or MS Singularity, or heck even BeOS was a clean break in many respects, with certain things implemented at low level and used throughout the OS.

Turns out compatibility and understandability is really useful, and it's good to define your complex systems in terms of simple systems. Worse is better.

Re:How Not to Write a Signal Handler by sillysaurus3 on Thursday November 27, 2014 @06:06PM (#8669050)
We wouldn't be better off, no. The newer OS would likely be less secure, less reliable, and probably less performant. It would also require all of the tools we take for granted to be ported to the new OS, which would be difficult since the above proposal is to change the API of the new OS.

It doesn't seem like there's anything wrong with libraries.

Re:How Not to Write a Signal Handler by wtetzner on Thursday November 27, 2014 @07:30PM (#8669233)
I don't see why it would be less secure, reliable, or performant. It might be that the new ideas, and new abstractions, make it harder to do things in insecure or unreliable ways.
Re:How Not to Write a Signal Handler by sillysaurus3 on Thursday November 27, 2014 @09:23PM (#8669414)
Reliability problems: You're going to be porting a lot of programs to this hypothetical OS. The porting process is going to be difficult and error-prone by definition, because the proposal was to make significant changes to the kernel API. This leads to...

Security problems: When you change the fundamental assumptions of a program, you open them up to security flaws. I am primarily referring to ported programs when I say "the new OS will have security problems."

Performance problems: The performance will be worse than existing OS's, because drivers that work for Linux probably won't work for this new OS. This means you're going to have to get by with slower video drivers, at least initially.

These three types of problems aren't impossible to overcome. I doubt 2,000 years from now that people will be using Linux, BSD, or Windows. But you will have to overcome them.

Re:How Not to Write a Signal Handler by nic0lette on Thursday November 27, 2014 @07:41PM (#8669253)
It's just that new programs often have more bugs in them, and bugs can sometimes end opening up an exploit vector.
Re:How Not to Write a Signal Handler by adamnemecek on Thursday November 27, 2014 @07:48PM (#8669268)
> It's just that new programs often have more bugs in them...

That sure is a broad brush that you are using.

Re:How Not to Write a Signal Handler by chris_wot on Friday November 28, 2014 @06:30AM (#8670568)
I dunno. In general that's true.
Re:How Not to Write a Signal Handler by angersock on Thursday November 27, 2014 @07:43PM (#8669259)
Have you heard of...

...Erlang? :)

Most of the real problems were solved years ago--they just haven't been used because reasons. :(

Re:How Not to Write a Signal Handler by teacup50 on Thursday November 27, 2014 @10:45PM (#8669564)
I don't understand your point; kqueue is a comparatively new idea.

Do you want signals written as messages across ZeroMQ? In that case, look at Mac OS X's use of Mach ports for exception handling, which is an even older idea than kqueue.

Re:How Not to Write a Signal Handler by julie1 on Friday November 28, 2014 @09:14AM (#8670959)
why not talk about soft IRQ?

The signal idea is to implement a user space soft IRQ like communication between process.

But we trigger them the wrong way

if should not be syslog that does kill -HUP daemon to have them release file but daemon that should have callback implemented like "on_file_destroy" and this event should be propagated to the root processes until the bubble up event is being stopped explicitly from being propagated.

The problem with that approach that is simple is it requires a careful definition of defined callbacks