Jump to content

  • Log In with Google      Sign In   
  • Create Account

tanzanite7

Member Since 20 Nov 2005
Offline Last Active Today, 08:45 AM

Posts I've Made

In Topic: What a web I Weave !

16 October 2014 - 06:39 PM

No, OP's tongue.png

Tabs = bad. There is no justification for them (IMMHO).

In Topic: how to redimensione (ReDim) an array in C++

12 October 2014 - 03:29 PM

Then re-implement what std::vector does or a small subset of it:

* allocate new block of memory

* move over the old values

* free the old block of memory

 

If you somewhy meant to resize stuff like "int array[66]" - then that is simply not possible.


In Topic: Threading question

02 October 2014 - 06:42 AM

I hope you appreciate this, a mandatory introduction into C++ in regards to its memory model:
 
http://channel9.msdn.com/Shows/Going+Deep/Cpp-and-Beyond-2012-Herb-Sutter-atomic-Weapons-1-of-2
 
I strongly recommend you spend the time watching it. I can not emphasize it enough: MT is not the land where you can just try what works and what does not - you need to understand what is going on (ie. the hows and whys). The linked talk is a good start i would say.

In Topic: Multithreading issues: Unit test fails sometimes

02 October 2014 - 06:13 AM

It doesn't explain why the X component of Position is screwed while the Y component is always fine.

I have no experience with boost - so, not sure i understand what it is expected to do here.

Anyway, if at any time multiple threads can work at the same data then what you are experiencing is exactly what one would expect.

In other words: "It doesn't explain why the X component of Position is screwed while the Y component is always fine." - No, that (unguarded overlapping data usage) explains it perfectly.

PS. testing MT parts of code only counts for the "basic-sanity-check" case - they are fundamentally utterly useless to check the actual validity of it beyond that.

Take a paper and pencil and revalidate your MT logic (in the end, that is the only way to write MT code) - you have a race condition (assuming you are proficient in MT land - then read relevant boost documentation to find where your assumptions clash with what it says).

In Topic: This chat, apparently, is a gigantic coding horror

01 October 2014 - 03:35 AM

The crucial bug in this brainfart of a code is not encoding "_" and not the order (it would still be broken regardless of order - the order does not matter, it just makes it worse).

 

Yep, deserved entry in coding horrors (our own daily wtf of sorts).


PARTNERS