[alsa-devel] Single vs. multiple seq client ports

Clemens Ladisch clemens at ladisch.de
Wed Feb 4 08:52:17 CET 2015


Tim E. Real wrote:
> What are the advantages and disadvantages if any, in terms
>  of speed and resources, of having a single client port versus
>  multiple client ports?

A port itself does not need much memory (it's just the name and other
metadata); as far as events are concerned, a port is just a number.
Events are stored in a client's buffer (in the sender's when they are
queued, in the receiver's when they are delivered).

A client's ports are stored in a linked list, and are looked up when
events are transmitted, so you should not have a very large number of
ports.

When the ports are visible to the user (because you want him to be able
to make connections dynamically), using multiple ports allows you to
expose different parts of your application (and use different
permissions, if this makes sense).  If the ports are not visible, it
might make sense to have multiple ones if you use the port number for
routing.


Regards,
Clemens


More information about the Alsa-devel mailing list