Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


Matt-D

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

https://jagt.github.io/clumsy/
 


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.)

http://stackoverflow.com/questions/11496826/transferring-ownership-to-function-with-stdunique-ptr

http://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/

https://msdn.microsoft.com/en-us/library/hh279676.aspx

 

It's also available in Boost:

http://www.boost.org/doc/libs/master/doc/html/move/reference.html#header.boost.move.unique_ptr_hpp

http://www.boost.org/doc/libs/master/doc/html/boost/movelib/unique_ptr.html

 

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:

http://herbsutter.com/2013/05/29/gotw-89-solution-smart-pointers/

http://herbsutter.com/2013/05/30/gotw-90-solution-factories/

http://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/


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
http://herbsutter.com/2013/02/11/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"
http://preshing.com/20141024/my-multicore-talk-at-cppcon-2014/

 

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

http://boost.org/libs/lockfree
 

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:

http://think-async.com/


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.

 

. . .
 

+1!

 

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


PARTNERS