All of lore.kernel.org
 help / color / mirror / Atom feed
* Single vs. multiple seq client ports
@ 2015-02-04  0:44 Tim E. Real
  2015-02-04  7:52 ` Clemens Ladisch
  0 siblings, 1 reply; 2+ messages in thread
From: Tim E. Real @ 2015-02-04  0:44 UTC (permalink / raw)
  To: alsa-devel

Hi. Our app currently uses a single alsa midi seq client port
 to address all external midi ports.

I have an opportunity now to change this to allow as many
 client ports as desired, for example one client port for each 
 external port found.

If I proceed, it is possible the user may have many client ports
 if desired.

What are the advantages and disadvantages if any, in terms 
 of speed and resources, of having a single client port versus 
 multiple client ports?

Thanks.
Tim.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Single vs. multiple seq client ports
  2015-02-04  0:44 Single vs. multiple seq client ports Tim E. Real
@ 2015-02-04  7:52 ` Clemens Ladisch
  0 siblings, 0 replies; 2+ messages in thread
From: Clemens Ladisch @ 2015-02-04  7:52 UTC (permalink / raw)
  To: Tim E. Real, alsa-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-04  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-04  0:44 Single vs. multiple seq client ports Tim E. Real
2015-02-04  7:52 ` Clemens Ladisch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.