Skip to content

Instantly share code, notes, and snippets.

@YigWoo
Created November 12, 2013 13:55
Show Gist options
  • Save YigWoo/7431193 to your computer and use it in GitHub Desktop.
Save YigWoo/7431193 to your computer and use it in GitHub Desktop.
Solution 3 CPU usage 50%
#include <boost/thread.hpp>
#include "windows.h"
#include <iostream>
void infiniteRunningLoop() {
while (1) {
;
}
}
int main() {
boost::thread thread1(infiniteRunningLoop)
boost::thread thread2(infiniteRunningLoop)
thread1.join();
thread2.join();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment