Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Jun 2008
Offline Last Active Jun 30 2016 04:05 AM

#5298543 Sharing object between 2 threads

Posted by on 29 June 2016 - 11:52 AM

Thanks for all the good answers. I realize that the better approach would be to use the same data structure in both threads, while having different classes.

What I am actually trying to do is:


The main thread handles the game logic and works on the resources (reading/writing them). The auxiliary thread handles the display only, reading only from the resources.


I want at a later point to be able to either have the render thread:


1. either read from the original data while the game logic thread waits (thus avoiding copying the resources at all).

2. either read from a copy of the original data, while the game logic continues its work.


In case 2 above, copying the resources will be done as a light copy first (i.e. actually sharing the resource until the point where the main thread modifies it: in that case, the main thread will first deep-copy the resource before modifying it, while the render thread will still read from the old, unmodified resource, thus avoiding a crash).

#5289198 Data alignment on ARM processors

Posted by on 29 April 2016 - 12:33 AM

Thanks to both of you for the very clear explanations!

#5217199 How to check application version with HTTP GET?

Posted by on 17 March 2015 - 05:04 PM

Thanks to all the replies! I guess I will go with libcurl, that looks the easier option.

#5134453 Adjacent camera display slightly different colors for same view patch

Posted by on 25 February 2014 - 10:50 AM

I forgot to add following: if the world does have a specular color component of 0, then the differences do not appear.


Edit: I think I can finally answer my question myself: I need a per-pixel shading, i.e. a pixel shader. Am I right? Sorry about the noise.

#5097904 GL_DEPTH24_STENCIL8_EXT not working ok on NVidia and Intel. ATI doing fine

Posted by on 30 September 2013 - 01:06 PM

Thanks to both of you.


I found the problem. Changing this line:


into this:


Makes the trick. The question is now why it worked on ATI cards with the wrong argument?!

#5001549 How to initialize std::vector with array data without internal copy operation

Posted by on 16 November 2012 - 09:02 AM

Thanks Rip-off!!

You are right, and I try to follow that way of doing nowadays. But my old code is a mess... ;)