Recent submissions

Comment · 11 years ago
1) How does a unikernel differ from a library OS? Is a unikernel a kind of library OS?

2) Is the specialization the important aspect? I see OSv referred to as a unikernel but it does no specialization, it supports almost the entire Linux ABI. I'd argue it is a library OS, though.

Comment · 11 years ago
The biggest value is that you don't have a link-time dependency, only compile-time. This means that you don't have to concern yourself with a lot of the versioning problems that plague C++ application deployment simply because your dependency is compiled into the binary.
Comment · 11 years ago
Just to add to this point, the difference is that Rust can only guarantee this for the standard library. I can similarly write a library with safe interfaces that can be (ab)used to cause UB and there's little that the Rust team can do. This is different from other "safe" languages.

This is why it's so important to establish what the responsibility and expectation is of library developers to uphold the safety guarantees that everyone else relies on. It only takes one bad library to destroy the safety guarantees everyone who is transitively using that library relies on.

Comment · 11 years ago
The list takes an OwningPointer to the object to be inserted. One of the requirements of this trait (which is unsafe to implement) is "the object cannot be moved while in the `LinkedList`." So Box would work, or a mutable reference would as well (the library implements the trait for these types already). The list itself doesn't do the allocation though.
Comment · 11 years ago
I think that the requirement is that anyone who releases a program that was linked with my library must also release it in a form that allows it to be relinked without the library. I'm not sure how that applies to Rust's linkage model.
Comment · 11 years ago
I have one here: https://github.com/dschatzberg/intrusive

It can be used in a freestanding (nostd) environment such as a kernel. It uses unsafe code but provides a safe interface. The primary technique is to embed the type that is iterated over in a larger struct which contains the links. This way I can give out references to the inner type without fear of invalidating the iterator.

Comment · 12 years ago
I think another problem is that an OS is not analagous to a website, it's more analagous to a web framework. And it's not like there are any framework building frameworks floating around
Comment · 12 years ago
You can look at OSkit as one attempt to do this. I think the overwhelming reason its not common is that no one wants to build an OS. If they do it's for the educational experience not practical use. This means hobbyists aren't interested in just using a framework.
Comment · 12 years ago
FYI both a TCP SYN and SYN/ACK can carry a payload (which could be the GET and RESPONSE)
Comment · 13 years ago
Because if I use M:N threading then logically one of my user threads blocked and a different one should run during my timeslice. The kernel however is unaware of how I use the kernel thread and will block, believing that I cannot proceed.

1:1 threading lacks this problem but operations such as creating threads or deleting them require syscalls and are therefore relatively expensive.

Comment · 13 years ago
A lot of the issues surrounding M:N threads are a result of poor operating system support. The central problem is that a syscall blocks a kernel thread even when there are more user level threads to run.

If operating systems supported something like scheduler activations (a 20 year old technique), then this becomes less of a problem. The gist of it is that every time the kernel thread would block, or gets scheduled, instead of returning back to where it was executing, it upcalls into a user level scheduler which can then choose to schedule user threads. Its a shame that this technique isn't more common.

Comment · 13 years ago
Head's Up Hold'em has a nash equilibrium. Therefore there is at least one mixed strategy (I do X with probability P in Y situation) which cannot be negative expected value to any other strategy. In this sense, there is an optimal strategy. It doesn't mean that it is the maximum expected value against a particular opponent, but no opponent can win by playing (which is largely the goal of a casino).

Opponent modeling is purely advantageous, but not necessary

Comment · 13 years ago
Sign bit means one bit represents the sign of the integer which is the case with the most significant bit in 2s complement.

If you flip the sign bit, the sign changes. It does not mean that if you flip the sign, the value is negated.

Comment · 13 years ago
Yes you're right. I should have been more specific that all signed integers have a sign bit.
Comment · 13 years ago
In 2s complement, the most significant bit is the sign bit. In fact all valid C integer representations have a sign bit.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton