Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
14 Views

rtcNewScene, rtcNewGeometry thread safety

Jump to solution

Are the rtcNewScene and rtcNewGeometry functions thread safe when called concurrently with a shared RTCDevice? I assume not but I don't want to put in redundant locking if it's handled internally.

0 Kudos

Accepted Solutions
Highlighted
Moderator
14 Views

All operations that take the

Jump to solution

All operations that take the device are thread safe, e.g. you can create scenes for a single device from multiple scenes. Other objects are typically not thread safe, thus you cannot attach geometries from multiple threads to the same scene. However, for different objects that works. thus each thread can work on a different scene. Similar each thread can work on separate geometries, but not on the same.

An exception are functions that only read state and are intended for rendering. E.g. the rtcIntersectXX and rtcInterpolateXX functions can get called from multiple threads (as long as no thread is modifying the underlying objects with some API calls).

 

View solution in original post

0 Kudos
3 Replies
Highlighted
Beginner
14 Views

Also, if I have multiple

Jump to solution

Also, if I have multiple RTCScene objects sharing a single RTCDevice, is it safe to modify the scenes (eg rtcAttachGeometry, rtcSetNewGeometryBuffer, rtcCommitGeometry, rtcCommitScene, etc) concurrently from multiple threads? Or should I be using multiple RTCDevice objects? Or a single RTCDevice with mutex locking?

0 Kudos
Highlighted
Moderator
15 Views

All operations that take the

Jump to solution

All operations that take the device are thread safe, e.g. you can create scenes for a single device from multiple scenes. Other objects are typically not thread safe, thus you cannot attach geometries from multiple threads to the same scene. However, for different objects that works. thus each thread can work on a different scene. Similar each thread can work on separate geometries, but not on the same.

An exception are functions that only read state and are intended for rendering. E.g. the rtcIntersectXX and rtcInterpolateXX functions can get called from multiple threads (as long as no thread is modifying the underlying objects with some API calls).

 

View solution in original post

0 Kudos
Highlighted
Beginner
14 Views

In my case different threads

Jump to solution

In my case different threads will always be working with different scenes and geometry, the only thing shared between threads is the device. I won't be modifying the same scene or geometry concurrently so it sounds like I will be safe. Thanks!

0 Kudos