[racket] Racket and concurrency

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Wed Jul 4 15:56:15 EDT 2012

On Wed, Jul 4, 2012 at 2:38 PM, Harry Spier <vasishtha.spier at gmail.com> wrote:
>>On Tue, Jul 3, 2012 at 1:56 PM, Robby Findler <robby at eecs.northwestern.edu> wrote:
>> >On Tue, Jul 3, 2012 at 11:33 AM, Harry Spier <vasishtha.spier at gmail.com> wrote:
>>> 3)  How does hyperthreading affect the number of places or futures I
>>> can run concurrently? For example if I have an i7 with 4 cores and
>>> hyperthreading, will that run 4 or 8 places concurrently?
>> You can run as many as you want concurrently (more than the available
>> number of cores) but if you create too many, you'll lose your
>> parallelism. Assuming you've left hyperthreading enabled and you have
>> a good algorithm, you should see 8 things happening at once, tho.
> Is there any reason to, or are there any situations where you'd want
> to have more places than available cores?

It is okay to have more places than cores and this might happen when
you cannot predict exactly how much work each place is going to have
(e.g. you might have some subdivison of the task but you don't know
for sure that there is an equal amount of work in each subpiece) so
you create twice as many places as cores to help offset that problem.

But if you have way way more places than cores, then Racket will spend
all its time dealing with the multiple places and you'll probably slow
things down, overall.


Posted on the users mailing list.