2. Who Am I?
• Numerous gems (dalli, memcache-client,
rack-fiber_pool, connection_pool, etc)
• Scalability/Performance guy
• Fibers and EventMachine
• Technical Lead at Carbon Five
4. What This Isn’t
• Threads vs Events vs Processes
• Threads won’t make you love Java
5. Definitions
• Concurrency - performing two operations
in tandem (e.g. two web requests)
• Parallelism - performing two operations
literally at the same time (requires two
cores)
Concurrent
Parallel
18. Lock Benchmark
# Results: Ruby 1.9.2, GIL means no parallel threading
# user system total real
# single locked 4.310000 0.010000 4.320000 ( 4.311850)
# threaded locked 4.230000 0.080000 4.310000 ( 4.307405)
#
# Results: JRuby 1.6.3, parallel threads mean massive lock contention
# user system total real
# single locked 4.080000 0.000000 4.080000 ( 4.080000)
# threaded locked 17.109000 0.000000 17.109000 ( 17.109000)
Context Switching!