4 ms·
BitKeeper uses signals to implement a paging data structure from a compressed backing store. I allocate the memory for my data structure that is backed by a fi
by wscott 10y ago
BitKeeper uses signals to implement a paging data structure from a compressed backing store. I allocate the memory for my data structure that is backed by a file on the disk and then use mprotect() to mark that memory as read-only. Later when trying to access that memory a signal handler traps the access and loads and decompresses the data from disk into memory.
This is only done for unix systems that implement the sigaction() POSIX signals. It is tricky to get right, but it does work.
BTW I did find I could never get OSX 10.4 to work correctly, but by 10.7 Apple had finally fixed the bugs in their signal code.
- monk_the_dog 10y agoOodbs used a similar technique to translate addresses from a large "global" address space into smaller "local" one. Here is a paper if you're interested (ftp://ftp.cs.utexas.edu/pub/garbage/swizz.ps). Did you discover this technique on your own? At any rate, very cool.