I've been experimenting with thread-safe priority queues in the "Core"
routing engine. This feature allows updateProperty() to be called from any
thread. That means processing of properties can be done in a thread
without having to worry about marshaling the data back to the main thread.
This is done by putting properties in a thread-safe queue that wakes up
the glib mainloop for processing. Because we are relying on the mainloop
we can take advantage of glib mainloop features such as prioritization.
glib supports 3 priority levels: High, Normal and Low. To take advantage
of this feature, I've added a new attribute to AbstractPropertyType called
priority. In addition to the 3 glib supported priority levels, I've added
a 4th called "instant". Instant priority does immediate routing of the
property to sinks and does not rely on the mainloop. The tradeoff is this
priority level is not thread safe like "High", "Normal" and
"Normal" is the default priority level.
Why do we need these features? Prioritization has been one of the features
most talked about since the beginning of the project. This fulfills that
feature without a lot of tears or custom code. We take advantage of well
established and tested code inside glib.
The code is right now in my personal experimental fork of AMB on github:
This is a pretty big change conceptually so I want to give lots of time for
comments before I merge it into the mainline branch.