Post tagged: Languages/C++

Exceptions in the Manycore Era

Here's some interesting reading on the challenges of and possible strategies for dealing with exceptions in concurrent versions of C++. The try...catch...finally model of exception handling introduces its own control flow. How will that interact with concurrent models in which you're passing around a "future" (essentially, an IOU …

Example of Surprising Closure Behavior

::: {style="font-size: 10pt; background: white; color: black; font-family: courier new"} What do you expect to be outputted from this program (note that line 19 captures the outer variable "i")?

[    1]{style="color: #2b91af"} [using]{style="color: blue"} System;

[    2]{style="color: #2b91af"} [using]{style="color: blue"} System.Collections.Generic;

[    3 …

ParallelApply: Distribute Calculations Over Multicore / Processors

This code applies a BackgroundFunction to elements of an IEnumerable using the ThreadPool. If you don't know what that means, it's probably not of interest to you:

::: {style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"} [   10]{style="COLOR: #2b91af"}     [delegate]{style="COLOR: blue"} [void]{style="COLOR: blue"} [BackgroundFunction …