View busy-waiting-example.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <vector> | |
#include <thread> | |
#include <iostream> | |
#include <unistd.h> | |
using namespace std; | |
mutex mtxData; | |
class Consumer | |
{ |
View ObserverPattern.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <vector> | |
#include <thread> | |
#include <iostream> | |
#include <unistd.h> | |
using namespace std; | |
class IObserver | |
{ | |
public: |
View MemoryAllocationHFT.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example program | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <time.h> | |
// *********************************** | |
// This is for measuring CPU clocks | |
#if defined(__i386__) | |
static __inline__ unsigned long long rdtsc(void) |