Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Threading, without threading?

Name: Anonymous 2012-08-07 15:58

Allow me to explain:

int x;
int y;

void inc_x() { x++; }
void inc_y() { y++; }

int  get_x() { return x; }

int main() {
    int i;

    for( i = 0; i < 10; i++ ) {
        inc_x();
        inc_y(); // executed after inc_x(), but why wait?
                 // why not execute inc_y() in a separate thread?
                 // So, is this 'automatic threading' been done before?
                 // Is it even possible?
    }

    return get_x();
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List