ConcurrencyHow I Learned to Love the ‘stache
Chris Williams (voodootikigod)
Iterative Designs + NoVA Languages (come and learn, but we don’t offer credit)
telnet 10.10.20.99 1337
Warning: YOUR MIND MIGHT BE BLOWN BACKWe cannot be held responsible for the effects of this presentation on your general view of the world
There will be no AJL or BP Pics, if that disappoints you, better leave now because so will the rest of the talk.
A little poll
PhD, MS, BS =~ Computer
I was a “business” major
eff this guy asking about degrees, I learned about the intertubes on the streets.
Honesty QuestionRails/Ruby/Merb makes me like a
schoolgirl near Michael Phelps?
put ‘em up, don’t be afraid; well unless you are afraid, then sorry for calling you out
Concurrency FW TT WF ?!
“..several computational processes are executing at the same time, and potentially interacting with each other.” - thx wikipedia
ConcurrencyI get to use every single processor in my computer... or every computer I have access to...
=> game on
Now an example...Notice the two processors,Notice the two processes,Can you guess the results?
Vintage
So concurrency is as easy as drinking beer with a girl?
Concurrency is hardDon’t just believe this guy... it really is...
Deadlock
Watchdog timers
Timeouts
Synchronization
Locking
Race Conditions
Fault Tolerance
Execution
Spawning
Monitoring
Thrashing
IPC
Concurrent Speak
Threads
Green Threads
Native Threads
Processes
Process
Lightweight Process
Green Process
Sharing is not CaringAt least in the multi-tasking world
Ruby + Concurrency
What’s on your laptops MRI <= 1.8Green is only good for Stoplights, Limes, and Guacamole
definitely not spandex
What will be on your laptopsMRI >= 1.9True Native Threading FTW
Fibers
Matz Can’t PatchSong available via Creative Commons
Zed Shaw
Rails on teh Rubyrails --version <= Rails 2.1.0 //get in line
Rails of Tomorrow // no more single threaded
// thx Josh Peek
Aside from being a flashback to CS 304How does this <expletive>ing information apply to anything I, soon to be social networking rockstar code pimp, am doing?
Hosting
Apache/Nginx
Mongrel
Thin
Ebb
Passenger
the new hotness
Glassfish
LOLCATS picture has beenremoved at the request of
maintaining some resemblanceof maturity
-- chris’s wife
ur doing it rong
Magic + Magic = ??
Unicorn???btw shout out to the unicorn centre for keeping the dream alive; without you the internet would just be normal
Fail Whalebut why?
CONCURRENCYConcurrency, or more appropriately lack of concurrency, is the reason for nearly all major programming problems since we first hooked up one computer to another.
Your objects can’t save you.
Get to the mustache already Lisp will save your programming soul
Concurrent Oriented Programming
+ Functional Programming
-----------------------------------------------------
Scala is another option, FYI
ErlangMassively Concurrent
Massively Scalable
Crowd ! {main_message, “LISTEN”}
No Variables, No Sharing, No Side Effects
What are you talking about?Erlang is on the radar with CouchDB, Facebook, IMDB, ejabberd, Amazon, and tonight’s telchat
Fuzedhttp://fuzed.rubyforge.org/
http://github.com/KirinDave/fuzed/tree/master
Rails on Yaws or Ride the Erlang Express
Fuzed on EC2Single command replication and server spin up/spin down.
Fault Tolerant (except when EC2 goes down)
http://jointheconversation.org/2008/06/06/fuzed-and-ec2/
Now is the time, this is the placeThe rise in Multi-core machines
The rise in information processing
The rise in networked computing devicesAll hail skynet
and you are still using only one thread?!??!?!?
Key PointsSo wake up the person next to you, please.
Learn something newThen apply it to what you are doing and teach it someone else
side project
DRY your knowledgeI am building this cool thing, its round and I am thinking about calling it the wheel, you want to help?
Stand on GiantsMost times you can see farther than anyone else
NoVA LanguagesMeeting every Monday
erlang:out event, September 20th 9am - 6pm
thread death“... for the first time in history, no one is building a much faster sequential processor. If you want your program to run significantly faster, say, to justify the addition of new features, you’re going to have to parallelize your program”
Hennessy and Patterson “Computer Architectures” (4th edition)
you ! {code, telchat}http://github.com/voodootikigod/telchat/
make
make run
> telchat:start().