Import message queue slab allocator

This allocator is protected by a spinlock.
Add ability to read/write message queue

The message FIFO is also protected by a spinlock.
Add support for blocking reads

This uses a semaphore to sleep readers until something becomes available to
read.
Spin a bit in message_queue_read before blocking

In the case that a new message is almost ready, this makes us almost as fast
as the version that never calls semaphores at all!
Fix build error on Linux

We need to include fcntl.h for O_CREAT and O_EXCL.
Simplify message_queue_message_alloc

We were speculatively reading the freelist head hoping to avoid locking the
spinlock if there's no free memory to reuse anyway. However, this could lead
to someone else sniping the last free message, causing us to have to retry.
So instead we'll go ahead and obtain the lock, since it only wastes time on
the slow path through malloc anyway.
Merge branch 'simplify-alloc'
Apply 3-clause BSD license
Add README.md
Fix error in example in README

The comment before the call to message_queue_tryread was inaccurate--this
function won't block until a message is available.
Remove stray backquote in README.md
README: Mention possibility of over-tuning to c2d

This was developed and tested on a MacBook Pro with a 2.67GHz Core 2 Duo.
It's possible it does unexpectedly worse on other machines.
Yield to OS in spinlock during contention

This yields a noticeable performance benefit on Linux and makes it less
sensitive to scheduler/priority. It's even a noticeable improvement on
Mac OS X!
Merge branch 'better-spinlock'

Conflicts:
	message_queue.c
Eliminate false sharing between freelist and queue

These structures can be independently locked, so they should live on
separate cache lines so accessing one doesn't slow down threads accessing
the other.

This introduces the CACHE_LINE_SIZE #define, which defaults to 64 if it
isn't set elsewhere. Setting this higher may be a good idea: it causes a
minor performance regression on my machine, but applications that care and
know their cache line size can set it appropriately anyway.
Merge branch 'eliminate-false-sharing'

Conflicts:
	message_queue.c
	message_queue.h
README.md: Update performance statement

The last few commits have resulted in a significant gain in performance.
message_queue_destroy: return void

This function can't return an error, so it shouldn't return anything.
message_queue_init: return success

Since this function returns an int, it should actually do so.
Merge branch 'master' into proper-return-values

Conflicts:
	message_queue.c
	message_queue.h