Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×

Comment Re:Programs people want to use... (Score 1) 449

Here's pure C, C++ would lead to slightly neater syntax.

void do_operation_on_all(my_struct *array, int size, threadfunc func){

  for(int i=0; i<size; i++){
     launch_thread(func, array[i]);
  }
}

Where launch thread is a function that calls the correct OS specific function to launch a thread (probably pthread in most cases).

It would then be called:

do_operation_on_all(array, size, func);  which is actually even simpler than your solution.

Comment Re:Programs people want to use... (Score 1) 449

Because in C and older versions of C++ launching a thread takes significant typing and ugly code,

Bullshit. It takes 1 function call- because if you had a need to do all that repeatedly, you would write the damn call once, turn it into a function, and let it be done. People didn't do it because the tasks weren't parallelizable- they had massive resource contentions on memory object. Contentions that would be non-trivial to solve, and would cause using threads to be a minimal gain or even a loss in efficiency.

Libraries like std::thread don't do anything that people weren't already doing- they just prevent people from going out and writing their own implementations. But any problems that would benefit from them were already being solved with roll your own solutions.

Comment Re:Why not as civilians? (Score 1) 223

Except in this case you totally would. You'd be signing up to be a hacker. There is no reason to deploy hackers outside of the US- you'd have lower access to infrastructure, making your goal more difficult. Whereas a member of the traditional army makes sense to deploy around the world.

As for undersea cables being cut- if the cables are cut and you can't reach the country you're attacking, the "cyberwar" is over.

Comment Re:Why not as civilians? (Score 1) 223

And that makes sense for people who will be in a live fire zone and shot at- having no training makes them a liability to those who will have to protect them. It makes no sense for people who will never leave the US and will work by typing on a computer. These people aren't soldiers. They're programmers and IT workers. By adding these restrictions onto them you reduce the pool of talent you can reach by eliminating people for useless reasons.

A better question though is why to put these people in the army at all. They have almost no overlap with the work of the army. It would make better sense to either keep them civilian or create a new division.

Slashdot Top Deals

"Here's something to think about: How come you never see a headline like `Psychic Wins Lottery.'" -- Comedian Jay Leno

Working...