Replace PVRManager::GetSensorState with lock-free shared memory structure (Eliminating sync IPC)

NEW
Assigned to

Status

()

Core
WebVR
a month ago
26 days ago

People

(Reporter: kip, Assigned: kip)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qf:p3])

Attachments

(1 attachment)

(Assignee)

Description

a month ago
A lock-free structure in shared memory is more efficient than an IPC message queue, will help reduce latency, and will eliminate the sync IPC message in support of Bug 1344216.
(Assignee)

Updated

a month ago
Blocks: 1344216
(Assignee)

Updated

a month ago
See Also: → bug 1306493
Whiteboard: [qf:p3]
(Assignee)

Comment 1

a month ago
For some background on the lock-free approach, see "Concurrent reading and writing" by Leslie Lamport:

http://dl.acm.org/citation.cfm?doid=359863.359878

This is applicable to VR headset state, such as positional tracking data, as it is updated by a single thread while being read by multiple threads.  Concurrent writing by multiple threads is not necessary.
(Assignee)

Comment 2

a month ago
(In reply to :kip (Kearwood Gilbert) from comment #1)
> For some background on the lock-free approach, see "Concurrent reading and
> writing" by Leslie Lamport:
> 
> http://dl.acm.org/citation.cfm?doid=359863.359878
> 
> This is applicable to VR headset state, such as positional tracking data, as
> it is updated by a single thread while being read by multiple threads. 
> Concurrent writing by multiple threads is not necessary.

Specifically, I would apply the "General Readers/Writer Solution" for this application.
(Assignee)

Comment 3

a month ago
We will also need to ensure that the solution is tolerant of preemption and does not result in crashing the content process if the GPU process is killed.
(Assignee)

Comment 4

a month ago
(In reply to :kip (Kearwood Gilbert) from comment #3)
> We will also need to ensure that the solution is tolerant of preemption and
> does not result in crashing the content process if the GPU process is killed.
Pre-emption effects can be avoided by limiting the number of iterations attempting to get a new headset state in the reader.  When a valid state is read, it will be copied to the reader's non-shared memory.  In the event of the writer being pre-empted for an extended duration of time, the reader should fall back to the prior recorded sensor states.
(Assignee)

Comment 5

26 days ago
Created attachment 8853505 [details]
GeckoProfiler timeline showing PVRManager::GetSensorState sync IPC blocking between 5ms and 66ms
You need to log in before you can comment on or make changes to this bug.