Blog posts January 2011

Producer-consumer problem in C

For my Operating Systems class CSCI360 we had to write the classic Producer-consumer problem in C using semaphores. This is a classic problem/solution to preventing race conditions over a shared resource.  For those of you who don't know what a semaphore is it's simply a variable that acts as a coun…

Read more

Redis on Rails

Quite often I see users asking on #rubyonrails how to setup a persistent connection with redis + rails. It's actually quite simple and you can go about it several ways.  A common approach I see is to use the global variable $redis throughout your Rails application. If you're on Rails 3.0 the config/…

Read more

2 blog posts