Posts Tagged atomic

C++ For C# Developers: Part 43 – Threading Library

Tags: , , , ,

As C# includes classes like Thread and Mutex, the C++ Standard Library also provides support for multi-threading. Classes like std::thread and std::mutex are very similar, but there are larger differences when it comes to C#’s lock, async, and await keywords. Read on to learn how to write multi-threaded C++!

Read the rest of this article »

2 Comments

Thread Synchronization Performance

Tags: , , , ,

Multi-threading is essential to performance on all modern processors. Using multiple threads brings along with it the challenge of synchronizing data access across those threads. Unity’s job system can do some of this for us, but it certainly doesn’t handle every case. For times when it doesn’t, C# provides us with a bunch of synchronization options. Which are fastest? Today we’ll find out!

Read the rest of this article »

4 Comments

NativeIntPtr and NativeLongPtr: Part 2

Tags: , , , ,

Last week’s article introduced two new native collection types: NativeIntPtr and NativeLongPtr. These were useful for both IJob and IJobParallelFor jobs, but performance was degraded in IJobParallelFor. Today we’ll remedy that, explore some more aspects of Unity’s native collection and job systems, and learn more about CPU caches along the way.

Read the rest of this article »

6 Comments

NativeIntPtr and NativeLongPtr

Tags: , ,

Today we’ll add two new types to the Native Collections suite: NativeIntPtr and NativeLongPtr. We’ll make them usable with both IJob and IJobParallelFor and explore some new features Unity’s native container system along the way.

Read the rest of this article »

8 Comments