Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 21 Oct 2011
Offline Last Active Aug 27 2015 05:12 AM

Posts I've Made

In Topic: Trying to emulate "typical" internet conditions

19 July 2015 - 10:25 AM

Perhaps this will be of some use:


https://github.com/tylertreat/Comcast // lovely name


In Topic: Is it advisable to use a scoped_ptr in CreateFrame? (D3DX9)

27 May 2015 - 01:22 PM

If you still have a single, unique owner at a time (which you should verify), then std::unique_ptr would be the way to go -- you can move it around, thus transferring ownership.

(In contrast, boost::scoped_ptr cannot be moved, let alone copied.)





It's also available in Boost:




TL;DR: you have to analyze and understand the exact ownership semantics that apply to your case at hand, everything else should follow from that.

In particular, you may want to familiarize yourself (thoroughly) with GotW #89 to #91:




In Topic: The Atomic Man: Are lockless data structures REALLY worth learning about?

05 April 2015 - 09:14 AM

I think this topic is interesting and worth knowing for game development (see Ubisoft examples later).


The good news is that -- if you'd like to learn -- there's now plenty of really good materials available.


I'd start with Herb Sutter's talks: atomic Weapons: The C++ Memory Model and Modern Hardware

Then, watch his CppCon 2014 talks, "Lock-Free Programming (or, Juggling Razor Blades)": http://herbsutter.com/2014/10/18/my-cppcon-talks-2/
* Part 1: Lazy initialization with DCL vs. call_once vs. function local statics, and lock-free mailbox algorithms
* Part 2: Lock-free linked lists, the ABA problem, and atomic smart pointers

(Note: "Example-driven talk on how to design and write lock-free algorithms and data structures using C++ atomic -- something that can look deceptively simple, but contains very deep topics. (Important note: This is not the same as my "atomic Weapons" talk; that talk was about the "what they are and why" of the C++ memory model and atomics, and did not cover how to actually use atomics to implement highly concurrent algorithms and data structures.)")

Last but definitely not least, I highly recommend following Jeff Preshing's (a Technical Architect at Ubisoft Montreal) blog: http://preshing.com/

For instance, check out his talk at CppCon 2014: "How Ubisoft Develops Games for Multicore - Before and After C++11"


Getting familiar with Boost.Lockfree shouldn't hurt, either:


Good luck!

In Topic: How to get Boost::asio working with MinGW

23 February 2015 - 09:59 AM

There are also MinGW distributions which already include pre-built Boost binaries:

- http://nuwen.net/mingw.html

- https://msys2.github.io/

Perhaps it would be easier to use one of these?


Alternatively, in case you only want ASIO, there's also a standalone (non-Boost) version only requiring a C++11 compiler:


In Topic: Some programmers actually hate OOP languages? WHAT?!

27 January 2015 - 09:21 AM

Problem is, I will never learn the right way to code from the wrong way if I don't share my code and no one explains it to me.

TL;DR - unless you've been telling everyone that you're the greatest software engineer who's ever lived, you should never feel like that.


. . .



To add to that:

- Egoless Programming: http://blog.codinghorror.com/egoless-programming-you-are-not-your-job/

- You Are Not Your Code: http://www.hanselman.com/blog/YouAreNotYourCode.aspx