next up previous
Next: Development and Debugging Convenience Up: Why use FUSD? Previous: Driver Memory Protection

Giving libraries language independence and standard notification interfaces

One particularly interesting application of FUSD that we've found very useful is as a way to let regular user-space libraries export device file APIs. For example, imagine you had a library which factored large composite numbers. Typically, it might have a C interface--say, a function called int *factorize(int bignum). With FUSD, it's possible to create a device file interface--say, a device called /dev/factorize to which clients can write(2) a big number, then read(2) back its factors.

This may sound strange, but device file APIs have at least three advantages over a typical library API. First, it becomes much more language independent--any language that can make system calls can access the factorization library. Second, the factorization code is running in a different address space; if it crashes, it won't crash or corrupt the caller. Third, and most interestingly, it is possible to use select(2) to wait for the factorization to complete. select(2) would make it easy for a client to factor a large number while remaining responsive to other events that might happen in the meantime. In other words, FUSD allows normal user-space libraries to integrate seamlessly with UNIX's existing, POSIX-standard event notification interface: select(2).


next up previous
Next: Development and Debugging Convenience Up: Why use FUSD? Previous: Driver Memory Protection
Jeremy Elson 2003-08-20