Quantcast

Event Parameter buffer (EPB)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Event Parameter buffer (EPB)

Paul Reeves

The EPB is clearly documented as being limited to 15 events. I did a
fairly rough grep of the code and I failed to find where this
limitation is enforced. And I couldn't find anything in the release
notes to indicate that anything has changed since InterBase days.

In practice this limitation is not a problem. It is also clearly
documented that if more than fifteen events need to be registered then
another EPB needs to be declared by the listener.

But the question comes to mind - is this still a limitation or has code
refactoring or the move to 64-bit silently removed the limitation
without anyone noticing? Or have I missed something while grepping the
code?



Paul
--
Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Event Parameter buffer (EPB)

Paul Reeves

Anyone ?

On Mon, 27 Mar 2017 11:12:47 +0200 Paul Reeves wrote

> The EPB is clearly documented as being limited to 15 events. I did a
> fairly rough grep of the code and I failed to find where this
> limitation is enforced. And I couldn't find anything in the release
> notes to indicate that anything has changed since InterBase days.
>
> In practice this limitation is not a problem. It is also clearly
> documented that if more than fifteen events need to be registered then
> another EPB needs to be declared by the listener.
>
> But the question comes to mind - is this still a limitation or has
> code refactoring or the move to 64-bit silently removed the limitation
> without anyone noticing? Or have I missed something while grepping the
> code?
>
>
>
> Paul
> --
> Paul Reeves
> http://www.ibphoenix.com
> Supporting users of Firebird
>  
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> Firebird-Devel mailing list, web interface at
> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>
>



Paul

--
Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Event Parameter buffer (EPB)

Vlad Khorsun-2
In reply to this post by Paul Reeves
27.03.2017 12:12, Paul Reeves wrote:
>
> The EPB is clearly documented as being limited to 15 events. I did a
> fairly rough grep of the code and I failed to find where this
> limitation is enforced. And I couldn't find anything in the release
> notes to indicate that anything has changed since InterBase days.

   I was sure i saw that limit in the code some time ago, but i failed to
find it now. I looked at both fb2.5 and fb3 code.

> In practice this limitation is not a problem. It is also clearly
> documented that if more than fifteen events need to be registered then
> another EPB needs to be declared by the listener.
>
> But the question comes to mind - is this still a limitation or has code
> refactoring or the move to 64-bit silently removed the limitation
> without anyone noticing? Or have I missed something while grepping the
> code?

   Below is a limitations i found in current code:

- event name length is stored in EPB using one byte,
   thus event name is limited by 255 bytes

- whole EPB length should be less than MAX_USHORT, i.e. <= 65535 bytes
   it means single EPB could contain no more than

     (MAX_USHORT - 1 - 1 /*for EPB_version1*/)
     /
     (1 /*name len*/ + 255 /*max name*/ + 4 /*event counter*/)

     = 252 events

   If i not missed somethig, up to 252 events per EPB should work at least
in v2.5 and later versions.

Regards,
Vlad

PS The my own guess why such low limitation is documented - it is not
practical to pass large (up to 64KB) packet over the wire every time a
couple of events (of up to 252 registered) is fired.

   Time to process this packet also matters - why waste time looking at
 >200 event entries for changes in counts when just a few of them really
changed.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Event Parameter buffer (EPB)

Paul Reeves
On Tue, 28 Mar 2017 12:51:34 +0300 Vlad Khorsun wrote

>
> PS The my own guess why such low limitation is documented - it is not
> practical to pass large (up to 64KB) packet over the wire every time a
> couple of events (of up to 252 registered) is fired.
>
>    Time to process this packet also matters - why waste time looking
> at
>  >200 event entries for changes in counts when just a few of them
>  >really  
> changed.
>

Thanks, Vlad, that makes sense.

So basically, the limitation would seem to be artificial for recent
versions of firebird, but still recommended from a performance
perspective. (Which is the whole point of using events in the first
place.)


Paul
--
Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Loading...