Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4b83acf authored by Shai Barack's avatar Shai Barack
Browse files

Store Messages directly in priority queues

Remove MessageNode indirection to eliminate a potential performance penalty.

To avoid ABA, we no longer recycle Messages in concurrent MessageQueue code.
The ABA happens because skiplist removal is by Message instance identity.
Potential ABA:
1. Thread 1 enqueues Message A
2. Thread 2 calls remove that would match A, starts iterating on skiplist, finds A
3. Thread 3 wakes up, polls A from queue, recycles it
4. Thread 3 obtains A from pool and enqueues it as a semantically new Message
5. Thread 2 remove()s A from skiplist

Bug: 415954362
Flag: build.RELEASE_PACKAGE_MESSAGEQUEUE_IMPLEMENTATION
Change-Id: Ib3a7ff94c5234c1d302cb4c9b04d1f963293641f
parent ee0b88cc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment