• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About Mike.Haddow

  • Rank
  1. Atomically Update Vector3D In Win32

    Interesting. I had assumed that the threading overhead would be low enough that splitting the update integration and the collision systems to different cores would make sense. I'm still interested in learning about lock-free and data orientated approaches though (so that I know what to look for if/when I get an F1 car). Are there any open source projects that you know of demonstrating these ideas?
  2. Atomically Update Vector3D In Win32

    Thanks Antheus. [quote name='Antheus' timestamp='1329142383' post='4912604'] Atomicity, especially on multi-core depends on cache lines. The problem you should be worried about is false sharing. When two cores work on values sharing the same line, each write causes a cache sync, stalling both of them. [/quote] I see! That also may explain why my experiments haven't shown anything close to the performance increase I was hoping for (from profiling I know that the physics systems are the bottleneck). I only recently started reading about processor architectures and caching issues, so I'm still pretty new at this. I'll work what you've said into my current experiment and post some code later.
  3. Atomically Update Vector3D In Win32

    Thanks Evil Steve. I'd thought of that before, but my original approach still had a race condition (I was using one array of data and 2 arrays of pointers - one of active but read only data and the other write only but mutable). But I may be able to overcome it using tagged pointers. I'll try it out and post some code shortly.
  4. Hi. This is my first post, but I've been following the forums for some time. I'm currently making the transition from XNA to C++ (various libs). I have successfully ported several projects, but my reason for making the change was for the performance benefits. I've been reading a number of posts/tutorials/presentations on data oriented design (notably Mike Acton's posts). This lead to a small performance boost in a single threaded environment, but now I want to multi-thread my task scheduler. I was hoping to make use of a lock free approach (similar to the gateway approach outlined here: [url="http://macton.smugmug.com/gallery/8611752_9SU2a/1/568079120_gzhk8#!i=568079120&k=gzhk8"]http://macton.smugmug.com/gallery/8611752_9SU2a/1/568079120_gzhk8#!i=568079120&k=gzhk8[/url]) but I'm struggling. Specifically, I am currently working on my physics system. I have one task that updates forces (simple vec3 PODs) by applying drag based on the current velocity. Likewise I have a collision resolution task. How can I atomically update the vector3D's on an x86? I was considering storing a queue in the gateway of requested changes, but this still wouldn't avoid one thread reading a vector while the gateway was midway through applying an update. Is the gateway approach unsuitable for non-PS3 games?
  • Advertisement