The memory model is perhaps one of the most valuable but misunderstood changes in c++11. For the first time, c++ programmers have a language contract with the runtime about how their code will be executed in the face of hardware optimizations, memory hierarchies and multiple threads of execution.
This talk introduces the key concepts in the memory model, and show how these concepts apply to the new atomic primitives in c++11.
It started pretty simply, I just wanted to have a screensaver on the big screen outside of our development lab to cycle though some webpages on our hudson server. I thought that there must be an open source tool somewhere that does what I need but alas couldn’t find anything out there. I am in general quite reluctant to download any free screensaver software from the web after the time I’ve spent fixing the computers of relatives after they downloaded a “screensaver”. After a few false starts (windows scripting of IE is not option for a screensaver (think what happens when you send a keypress to a screensaver!)) I finally came across a quite simple solution using C# and Windows Forms, based on the tutorial at Geekpedia. I put the source up on github so hopefully no one else will have to learn the hard way :-)
Things to watch out for:
- There is a difference between the WPF WebBrowser control and the Windows Forms WebBrowser control.
- The WPF WebBrowser doesn’t expose the full functionality of the control so this is a bad otion for the screensaver (in particular you want to suppress the scripting errors dialogs).
- You have to add the mouse and keyboard event listeners not to the WebBrowser control but to each document as it’s loaded.