Tom,

I'm re-writing that portion of other's code using SCOPE attribute of value "session" for locking now to support concurrent users for the app.

Will test it to see result and update you and Isaac.

Thanks again.

Don
P.S.
"Incidentally I noticed a lot of people using createUUID()
for the named locks.", I think it's an easy misunderstanding that associates CFLOCK with the normal concept of lock.

>[Tom Kitta]
>Well, as always in these situations I did a quick check as how things are in
>the real life. Here is my code:
><cfset mm = GetTickCount()>
>
><cfloop index="m" from="1" to="10000" step="1">
> <cflock timeout="30" throwontimeout="Yes" type="EXCLUSIVE" scope="SESSION">
>  <cfset session.blob = 123>
> </cflock>
></cfloop>
>
><cfoutput>Scoped: #GetTickCount() - mm#</cfoutput><br>
>
><cfset ww =  GetTickCount()>
>
><cfloop index="m" from="1" to="10000" step="1">
> <cflock timeout="30" throwontimeout="Yes" name="hfjdshfkshfks"
>type="EXCLUSIVE">
>  <cfset session.bleeh = 123>
> </cflock>
></cfloop>
>
><cfoutput>Named: #GetTickCount() - ww#</cfoutput><br>
>
>
>I didn't see any performance differences. Maybe it is apparent with more
>variables used? Incidentally I noticed a lot of people using createUUID()
>for the named locks. Wow, performance dies right there.
>
>You can run it yourself from:
>http://dev.energyshop.com/tk/mytest.cfm
>[Tom Kitta]
>I think it might also be a personal preferance.
>
>TK
>
> The rule of thumb is that properly named locks will perform better
>than scope locks, however, because you have complete control over the
>names, named locks can perform worse than scoped locks if the name
>provided is inspecific, i.e.
>
><cflock scope="session">
>
>will probably perform better than
>
><cflock name="session">
>
>(assuming the same scheme is used for locking the same events
>throughout the application)
>
>on the other hand
>
><cflock name="#getcurrenttemplatepath()#">
>
>will perform _much_ better than
>
><cflock scope="session">
>
>s. isaac dealey   214.823.9345
>
>new epoch : isn't it time for a change?
>
>add features without fixtures with
>the onTap open source framework
>http://www.sys-con.com/story/?storyid=44477&DE=1
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to