[haiku-bugs] Re: [Haiku] #4954: Proliferation of BBuffer instances when playing sound

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Wed, 20 Mar 2019 23:25:02 -0000

#4954: Proliferation of BBuffer instances when playing sound
------------------------------+-----------------------
   Reporter:  Adek336         |      Owner:  Barrett
       Type:  bug             |     Status:  reopened
   Priority:  normal          |  Milestone:  R1
  Component:  Kits/Media Kit  |    Version:  R1/alpha1
 Resolution:                  |   Keywords:
 Blocked By:  14755           |   Blocking:
Has a Patch:  0               |   Platform:  All
------------------------------+-----------------------

Comment (by waddlesplash):

_start_watching_system is already used by the registrar so you are not
 going to solve the issue.

 Yes, it was added by tqh rather recently in hrev52796. A cursory look
 reveals that it should likely be sending notifications for this, but that
 code is behind quite a lot of branches and I didn't test it just now.

And I think this syscall is going to be quite heavy, so not a good idea
 anyway.

 This only shows you do not know what you are talking about here. The
 
[http://xref.plausible.coop/source/xref/haiku/src/system/kernel/system_info.cpp#628
 syscall implementation] simply calls
 
[http://xref.plausible.coop/source/xref/haiku/src/system/kernel/system_info.cpp#StartListening
 SystemNotificationService::StartListening], which is not very "heavy" at
 all; it just creates a listener and inserts it into a doubly-linked list.
 In fact:

 {{{
 [  1908] _kern_start_watching_system(0xffffffff, 0x1f, 0xf7, 0x0) =
 0x00000000 No error (3 us)
 }}}

 That's right, **3 microseconds**! This is even faster than a write() to
 stdout (5-6 us, depending on length.)

 And of course one only need to call it once; after that you simply receive
 messages about whatever events occurred to the port specified, same as
 with a BRoster watcher.

 Actually it is extremely funny that you write this, for in your very next
 comment:

I require some due diligence when developing. Maybe it's a too high
 level for you, but

 And of course you did none of this due diligence yourself when speaking of
 _start_watching_system.

However now I realize that you are continuing to trust "someone" else
 position on that.

 And there you go with the conspiracy theories again...

-- 
Ticket URL: <https://dev.haiku-os.org/ticket/4954#comment:25>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: