4 ms·
> So POSIX support is a given on most systems. Why replace it with something that breaks existing code? Because POSIX has horrible security properties, and doe
by naasking 9y ago
> So POSIX support is a given on most systems. Why replace it with something that breaks existing code?
Because POSIX has horrible security properties, and does not provide enough guarantees to create truly robust software. See for instance, the recent article on how you simply cannot implement atomic file operations in POSIX -- sqlite has to jump through 1,000 hoops to get something pretty robust, but it shouldn't be this way.
- rurban 9y agoThe biggest problem is the blocking IO. With async throughout you can design a proper concurrent system.
- dingo_bat 9y agoIs there an example of an os which doesn't have blocking io? To me it seems that blocking io will be needed at some level. You can of course put wrappers around it and present it as async. But in many applications you want to go as low as possible, and in my imagination blocking calls will be the lowest.
- zzzcpan 9y agoIt's the other way around. Low level is all async everywhere, blocking is sort of just telling the kernel to wait for async op to complete before running the process.
- rurban 9y agoMidora, Singularity in an OS. Pony in a language. The goal is to avoid blocking, not to offer async also. That's a lost cause. Fuchsia once had the goal to offer async only, but then some manager decided that he needs some blocking, and then it was gone. non-blocking only is lower level than blocking. You can always wait indefinitely for that callback, but usually you have a default timeout. L4 for example offers that API.
- zaarn 9y agoThe Linux kernel has Async IO. For a while now. You don't need async for a proper concurrent system. Systems have been concurrent before async IO. The trick is that when a process does an IO you yield it and put it on a wait list and run literally anything else until the kernel receives the OK from the hardware control and resumes the process. Using Async IO in Linux merely means your specific thread won't be immediately suspended until you get data (or it's in a reasonably close cache) It would be quite silly if Linux would wait for every IO synchronously, any single core system would immediately grind to a halt.
- pjmlp 9y agoWhich isn't part of POSIX.
- zaarn 9y agoAIO is definitely part of POSIX. http://pubs.opengroup.org/onlinepubs/009695399/basedefs/aio.h.html http://pubs.opengroup.org/onlinepubs/009695399/basedefs/aio....
- pjmlp 9y agoI thought you were speaking about some Linux specific APIs.
- zaarn 9y agoThere are some Linux specific APIs that build on this and I've got the most experience with Linux so I was refering to that. But Async IO is part of POSIX. I was mostly responding to the comment which cited synchronous IO as a problem with POSIX. Linux is most widely used so on top of being my primary domain on the issue, it's going to ensure best understanding.
- elderK 9y agoThat's not to say it's implemented as efficiently as it could be. See here: https://linux.die.net/man/7/aio https://linux.die.net/man/7/aio AFAIK, system-specific APIs such as epoll or kqueue are the way to go if you're serious about performing asynchronous IO?
- mempko 9y agoAnd yet here I am, working day in and day out on a POSIX system, uptime in the years range... strange.
- deleted 9y ago[deleted]
- naasking 9y agoAnything can be made to work with enough effort! Imagine how much easier it would be if POSIX actually had a better API.