Re: [AMB] AMB Digest, Vol 4, Issue 1
by Marek Timko
Hi Kevron,
please try to avoid to operators like:
bool operator == (AbstractProperty & other)
{
return (other.name() == name()
&& other.ambPropertyName() == ambPropertyName()
&& other.sourceFilter() == sourceFilter()
&& other.zoneFilter() == zoneFilter());
}
here it will has to compare 3 strings which can be very slow.
-- Marek
On Mon, Jul 7, 2014 at 9:00 PM, <amb-request(a)lists.01.org> wrote:
> Send AMB mailing list submissions to
> amb(a)lists.01.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.01.org/mailman/listinfo/amb
> or, via email, send a message with subject or body 'help' to
> amb-request(a)lists.01.org
>
> You can reach the person managing the list at
> amb-owner(a)lists.01.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AMB digest..."
>
>
> Today's Topics:
>
> 1. Experimental Multi-threading and priority queues (Kevron Rees)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 6 Jul 2014 17:19:20 -0700
> From: Kevron Rees <tripzero.kev(a)gmail.com>
> To: "amb(a)lists.01.org" <amb(a)lists.01.org>
> Subject: [AMB] Experimental Multi-threading and priority queues
> Message-ID:
> <
> CAAOZRYUrSWjomhvJ6RwmdudsybXYt0kY3vfBjzbibwYjcBveLw(a)mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 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 "Low".
>
> "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:
>
> https://github.com/tripzero/automotive-message-broker
>
> 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.
>
> -Kevron
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.01.org/pipermail/amb/attachments/20140706/152b2321/attachmen...
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> AMB mailing list
> AMB(a)lists.01.org
> https://lists.01.org/mailman/listinfo/amb
>
>
> ------------------------------
>
> End of AMB Digest, Vol 4, Issue 1
> *********************************
>
6 years, 7 months
Experimental Multi-threading and priority queues
by Kevron Rees
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 "Low".
"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:
https://github.com/tripzero/automotive-message-broker
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.
-Kevron
6 years, 7 months