Thread Safety .. or Ignoring Thread Safety
Problem:
The voxel object needs to be drawn by the graphics thread and updated by the haptics thread. The Haptics Programmers PDF suggests creating a snapshot for shared data because the haptics thread runs considerably faster and can change the data while the graphics thread is attempting to draw the object. Creating a snapshot would mean that at the worst case a 3D array 128^3 would have to be copied 60 times per second.
Partial Solutions and Assumptions:
The graphics thread is a read-only thread while the haptics thread is a write-only thread. The collision detection exists in the haptic thread so the data needs to be correct. The proposed solution is to overlook the possibility of inconsistant data for the graphic thread and have one object shared between the two threads. It is unknown if there will be a noticable display lag in the graphics thread. This issue will be tracked throughout the course of the project.
The voxel object needs to be drawn by the graphics thread and updated by the haptics thread. The Haptics Programmers PDF suggests creating a snapshot for shared data because the haptics thread runs considerably faster and can change the data while the graphics thread is attempting to draw the object. Creating a snapshot would mean that at the worst case a 3D array 128^3 would have to be copied 60 times per second.
Partial Solutions and Assumptions:
The graphics thread is a read-only thread while the haptics thread is a write-only thread. The collision detection exists in the haptic thread so the data needs to be correct. The proposed solution is to overlook the possibility of inconsistant data for the graphic thread and have one object shared between the two threads. It is unknown if there will be a noticable display lag in the graphics thread. This issue will be tracked throughout the course of the project.
0 Comments:
Post a Comment
<< Home