If you guys want to embed redis into a single process w/ no threads,
it is fairly simple. You can just strip out the parts that start the
server and then use the createFakeClient() API.
If you want to embed redis into a multi-threaded process, this is a
problem. redis is written to be single threaded, that is why it is so
fast, there are no locks, no latches, etc... changing the code to be
multi-threaded is most likely not going to happen (for good reasons).
InMemory Databases dont really need threads, as they dont need to wait
on I/O devices as much as Disk Based Databases. Some argue that cpus
wait on the memory wall, but Ive benchmarked this with RAM @1066 and
RAM @400MHz and it only happens in Datawarehousing loads (not OLTP
loads, what redis is designed for).
There are other issues w/ embedding redis. Since its a single process,
its best that it stay pinned to a single core to optimise L1/L2 Cache
hit ratios. If the threads accessing this are spread evenly over 4
cores, then accessing redis on core1 causes context switches and cross-
core communication ... sometimes the chip does all this w/o hiccups,
and sometimes it gets ugly.