Simulating Thrashing with C++