Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 05 Mar 2004
Offline Last Active Yesterday, 01:57 AM

Posts I've Made

In Topic: (Super) Smart Pointer

12 July 2014 - 03:25 PM

The other way to do it is to have the object know at all times what lists it is stored in, and upon being deleted from the master list, fully removes itself from the other lists. This technique requires a lot of care in that you don't want to be iterating over a list containing the item, somewhere higher up the call stack, for example.

I would consider using the shared + weak pointer method first.

In Topic: c++ function pointers

12 July 2014 - 02:49 PM

I have actually used function references too, for the same reasons you'd use references over pointers to variables.

In Topic: Karatsuba algorithm

17 May 2014 - 04:50 PM

I hope that optimism pays off for ya.

In Topic: Karatsuba algorithm

16 May 2014 - 06:41 PM

Yeah I really should change mine to just use a vector internally. I had been trying to be clever and save space.

Modulo wrap around is very easy for fixed-sized values. It just means you only keep the n lowest bits of the result.

But certainly for a variable-sized bigint, unsigned doesn't really make sense.


Your code seems to be very high level and well commented. Mine is more designed for high performance and less need to understand how it works hence less commenting.

In fact your code reminds me of this: http://ericlippert.com/2013/09/16/math-from-scratch-part-one/

In Topic: Most efficient way to write identical data to 2 memory locations simultaneously

16 May 2014 - 06:40 PM

This sounds similar to the problem of drawing the screen bitmap in one thread and transferring that to the graphics card in another.

When you don't want either thread to have to wait for the other, then the general solution is to use triple-buffering.

Have a read of this and see if it might be what you are looking for: