> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:ibm-m...@bama.ua.edu] On Behalf Of zMan
> Sent: Friday, July 02, 2010 7:41 AM
> To: IBM-MAIN@bama.ua.edu
> Subject: Re: Unix systems and Serialization mechanism
> 
> What is the overall locking mechanism? If program A is 
> reading /some/file
> and program B does a rm on it, what happens? From observed 
> behavior, I think
> the file doesn't go away until A is done with it. I'm told that:

A file's "name" is an entry in a directory. This name relates to an inode and 
is usually called a "link". An inode is a separate structure on disk. A single 
inode can be pointed to by many names, even in separate directories, but all in 
the same filesystem. The inode contains a "link count" which indicates how many 
names the file has, in one or more directories. When the link count goes to 
zero due to an rm (or unlink() function) and the file is not open, then the 
kernel tells the vfs to delete/release the inode on disk. If the file is open 
and the link count is zero, then the kernel does not tell the vfs (filesystem) 
to release the inode until "open count" goes to zero. During this time (file 
open, but link count is zero), it is possible to create a new link (directory 
entry name) for the file and thus "restore" it.



> 
> Unix uses shared memory and mutex locks to ensure that files 
> are locked
> between processes.  How was that implemented on z/OS?

I don't know, but I'd __guess__ the same way. Perhaps someone "in the know" 
will speak up. Again, UNIX does not do this locking, the application does it. 
Unless you are talking about how the VFS/PFS does it. Perhaps the book:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/BPXZB5A0/CCONTENTS

is what you want?

> ...and I'd like to understand it more. Anyone have any pointers?
> 

--
John McKown 
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john.mck...@healthmarkets.com * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or 
proprietary information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. 
HealthMarkets(r) is the brand name for products underwritten and issued by the 
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance 
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The 
MEGA Life and Health Insurance Company.SM

 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to