Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GT.M Locks

117 views
Skip to first unread message

David Heller

unread,
Apr 19, 2013, 6:30:42 PM4/19/13
to
Hello

I am attempting to test my latest gtcm_gnp_client for php and I was wondering how to test if locks are working properly or not. I have tried going into a console and execute zshow "G' (or "L') and I never see any locks occurring even though my app says there is. From what I understand zshow only works in the context in which it is used. Is there another way to tell if locks are really working?? Also the docs really does not cover locks really thoroughly perhaps because of the ability to use transactions now and that is now preferred over using locks.

Dave

OldMster

unread,
Apr 23, 2013, 8:05:42 PM4/23/13
to
David,

Read Chapter 8 of the administrative operations manual (M Lock Utility). Standard M (and therefore GT.M) doesn't really give you a way to 'see' what locks your process currently holds (or any other process of that manner). GT.M provides a separate utility to give you information about locks.

Mark

Ray Newman

unread,
Apr 23, 2013, 11:08:25 PM4/23/13
to
Mark,

How about ISO/IEC 11756 MUMPS STANDARD

7.1.3.5 ^$LOCK
^$L[OCK] ( expr V nref )
will provide information on the existence and operational
characteristics of locked names.

Ray

OldMster

unread,
Apr 24, 2013, 12:24:00 PM4/24/13
to
Ray,
The only improvement that made was that you could tell if a lock existed even if your own process owned it. The 'operational characteristics' were never standardized. Cache only tells you that a lock exists, nothing else. GT.M didn't implement these functions (unless it was done in the last couple of releases I haven't fully reviewed yet). Other than for your own locks, it really isn't any better than L +globalref:timeout s locked=$T s status=$S(locked:"Not Locked",1:"Locked")
Mark

David Heller

unread,
Apr 24, 2013, 2:12:15 PM4/24/13
to
Thanks for the replies

For now I'm going to assume its working because I don't get any indication otherwise.

Dave

K.S. Bhaskar

unread,
Apr 24, 2013, 4:33:18 PM4/24/13
to
There's probably not a whole lot I can add to the discussion.

1. GT.M does not implement structured system variable names (SSVNs).

2. In a GT.CM client server configuration, LKE must be run on the server computing node to see locks. The GT.CM server process owns M locks on behalf of clients. On client processes, ZSHOW "L" will provide the client process with M locks it thinks it owns, but in a GT.CM client server environment where the client is a PHP program that communicates with the server using GNP, there is no way for PHP code to know what locks it has unless it keeps track of it.

For testing, perhaps you can have a client process get a lock, and then confirm that an attempt by a different client process to get the same lock fails.

Regards
-- Bhaskar

Ray Newman

unread,
Apr 24, 2013, 8:37:03 PM4/24/13
to
Depends on the implementation. MUMPS V1 implements $ORDER and $DATA so you can do a $ORDER(^$LOCK("")) to scan all locks. Not really useful to implement it and then not allow a MUMPS type access to it.

Ray

David Heller

unread,
Apr 25, 2013, 1:41:20 PM4/25/13
to
Thanks Bhaskar

I went into console mode and performed a lock on the subject global and my php lock command failed.

Dave
0 new messages