Quote:
Originally Posted by wparsons
I think you're mixing up multi threaded with designed for multiple cores (parallel processing). You can easily have multi threaded applications on a single core. Modern OS' also try their best to spread load out over multiple cores, but that's entirely seamless to the application. The application can do things to help the OS, but it isn't necessary.
|
'green threads' and actual hardware threads are two entirely different things. concurrency != parallelism.
for instance:
Code:
10.times do |i|
Thread.new do
puts "doing something the #{i.ordinalize} time"
end
end
creates a concurrent operation, but not a parallelized one in MRI ruby. in jruby it would be both because jruby is built on the jvm and supports hardware multithreading, where MRI only supports green threads. it's an important distinction.
TL;DR - you can run multiple 'green' threads on a single hardware core and achieve
concurrency, where
parallelization requires multiple hardware threads (and bespoke cores to run them on).
OK now back to toni screwing brandon over...