On Nov 1, 2016, at 6:00 PM, Tony Ringsmuth wrote:

> Like Add said:
>> Now it is your chance to make changes in your Trigger
>    methods and remove/replace any found thread-unsafe code.
> 
> Here’s your chance to go and re-program ALL of your triggers.

I did a quick survey of all the triggers in one database that I will be 
upgrading to v16 to see if they had any "offensive” commands or IP variables. 

No offensive commands. So no issues there. Yeah!

But I am referencing 1 IP variable: <>officeCode_t. I will have to replace that 
with a method that would probably look something like this:

// GetOfficeCode

C_TEXT($0)

READ ONLY([SystemData])
ALL RECORDS([SystemData])
$0:=[SystemData]OfficeCode

So here is a real world example. Set <>officeCode_t in the On Server Startup 
method so that it is there for triggers. Makes it super fast to get the “office 
code” in triggers by referencing the <>officeCode_t.

The big question is will changing using <>officeCode_t in triggers to use the 
method above be significantly slower? 

[SystemData] will of course be in the data cache. So no disk I/O will be 
needed. I would guess that the ALL RECORDS command would probably be the 
command in the method that takes the most time to execute. And you will have 
the extra overhead of calling method “GetOfficeCode”, 

So switching from simply referencing <>officeCode_t to calling the method 
“GetOfficeCode” is certainly going to take longer. But I have no idea how much 
longer it will take. Probably a worthwhile trade-off to get preemptive to work 
in my triggers.

Tim

********************************************
Tim Nevels
Innovative Solutions
785-749-3444
[email protected]
********************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to