View Single Post
Old 02-18-2014, 04:31 PM   #177
jamesm
Banned
 
Join Date: Mar 2013
Drives: 2013 FR-S
Location: Orlando, FL
Posts: 2,929
Thanks: 1,166
Thanked 2,294 Times in 1,180 Posts
Mentioned: 313 Post(s)
Post

Quote:
Originally Posted by wparsons View Post
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...

Last edited by jamesm; 02-18-2014 at 04:47 PM.
jamesm is offline   Reply With Quote