Page 1 of 1
What is LockBreather?
Posted: Mon Aug 23, 2010 5:24 am
by bunchukokoy
Hi! Guys,
good day!
I wonder why there's no 'lockbreather' function definition in the Help. Actually I don't know what its use is. I just see it in my colleagues' code but I don't bother to ask, so I search for it and no version has its definition and function. Please someone explain to me.
Thanks!
bunchukokoy
Re: What is LockBreather?
Posted: Mon Aug 23, 2010 5:35 am
by Alan Kirk
bunchukokoy wrote:
I wonder why there's no 'lockbreather' function definition in the Help. Actually I don't know what its use is. I just see it in my colleagues' code but I don't bother to ask, so I search for it and no version has its definition and function. Please someone explain to me.
Curiously, I can find this referred to in only one document; the 8.4.5 release notes. I'm guessing that it was an evolutionary dead end which became redundant, especially after the new locking model was released in 9.1. Anyway, just for laughs here's how it's described:
8.4.5 Release Notes wrote:The following features were introduced in previous TM1 8.4 releases.
New LockBreather TurboIntegrator Function
This new function forces a TurboIntegrator process to take a ‘breather’ and check for pending write requests issued against the TM1 server. The LockBreather function can be used only after the LockOff function has been executed and before the LockOn function has been executed.
Syntax
LockBreather;
Arguments
None
Examples
When the LockOff function is executed in a TurboIntegrator process, TM1 automatically issues a breather after every 100 records in the data source are processed. This ensures that write requests have regular access to the TM1 server during process execution. However, if a TurboIntegrator process includes a lengthy While loop, the amount of time between breathers can become unacceptably long.
For example, consider a TurboIntegrator process using an ASCII data source with 100,000 records. After the LockOff function is called in this process, a breather should occur every 100 records (multiple times a second) and the entire process should take less than ten seconds to execute.
If you add the following While loop to the Data procedure, the amount of time required to process each record in the data source increases from less than one second to approximately twenty seconds:
Code: Select all
i=0;
while (i<5000000);
i=i+1;
end;
With the introduction of the While loop, the breather now occurs approximately every 2000 seconds (20 seconds per record x 100). In this scenario, you can use the LockBreather function to increase the breather frequency. Modify the code above as follows:
Code: Select all
i=0;
z=0;
while (i<5000000);
if (z=100000);
LockBreather;
z=0;
endif;
i=i+1;
z=z+1;
end;
With the above modification, the breather occurs 50 times in the 20 seconds it takes to execute the While loop.
Similarly, if TurboIntegrator is processing a data source over a WAN, a breather every 100 records may not be sufficient due to latency issues. In this circumstance, you can add a counter to the process and use the LockBreather function to force a breather at more frequent intervals. For example, to force a breather every 50 records, initialize the counter (i) to 0 in the Prolog procedure and add the following code to the Data procedure:
Code: Select all
i=i+1;
if(i=50);
LockBreather;
i=0;
endif;
Re: What is LockBreather?
Posted: Mon Aug 23, 2010 5:47 am
by bunchukokoy
Wow!
Thanks! Allan,
It's clear to me now. Great! Thanks!
bunchukokoy

Re: What is LockBreather?
Posted: Mon Aug 23, 2010 7:20 am
by lotsaram
LockOn
LockOff
LockBreather
AllowExternalRequests
ReadersBypassWriters
all dead and buried, may they rest in peace.
Re: What is LockBreather?
Posted: Mon Aug 23, 2010 8:46 am
by bunchukokoy
Uhm,
May I know, what do you mean 'All dead and buried'?
Do you mean that none of these functions are usable, because they're not recognized by TM1 anymore?
Or simply because, these are seldom used?
Why do you say so?
Thanks!
Re: What is LockBreather?
Posted: Mon Aug 23, 2010 11:10 am
by lotsaram
While these functions (and parameters in the case of ReadserBypassWriters) will not cause any errors they are redundant and now have no real effect or meaning in 9.1, 9.4 and 9.5 due to changes in the TM1 object locking model.