Thread Types

y Run at OS level y CPU time+ y HARD

y Run inside the VM y Small overhead y Cooperative scheduling

Fibers vs. Theads

a) Two execution threads; one thread blocks for 40ms on an IO call and then takes 10ms to post-process the data; second thread needs 50ms of pure CPU time b) Same scenario implemented with Fibers and cooperative scheduling

Event-Driven Programming
y Reactor pattern
y Event loop sends to request handlers y i.e. Python s Twisted, Eventmachine, Node.js

y Nested callbacks

Asyncas Sync

Use Cases
y Computationallyexpensive tasks
y Sorting y Map-reduce

y Blocking requests
y Filesystem IO y Network IO

y y EM-Synchrony

Sign up to vote on this title
UsefulNot useful