Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP 9000 Networking: HP FTAM/9000 Programmer's Guide > Chapter 3 HP FTAM/9000 Data Structures

Ft_concurrency_control

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

struct  Ft_concurrency_control {
enum Ft_file_lock read;
enum Ft_file_lock insert;
enum Ft_file_lock replace;
enum Ft_file_lock extend;
enum Ft_file_lock erase;
enum Ft_file_lock read_attribute;
enum Ft_file_lock change_attribute;
enum Ft_file_lock delete_file;
};

Ft_concurrency_control Is Input To These Functions

Ft_concurrency_control Is Output From These Functions

ft_create()

ft_fcopy()

ft_fcattributes()

ft_fdelete()

ft_fmove()

ft_fopen()

ft_frattributes()

ft_open()

ft_select()

ft_fopen()

ft_open()

Concurrency locks define whether users can simultaneously access a file. Ft_concurrency_control specifies the type of available concurrency locks for each action on a file.

Change Attribute

Delete File

Erase

Extend

Insert

Read

Read Attribute

Replace

Each value is of type enum Ft_file_lock which specifies the type of concurrency locks on a file.

Setting allowable file actions and locks requires that you follow a few rules. Familiarize yourself with struct Ft_concurrency_control and enum Ft_file_lock, and then review the rules in the "Rules for Ft_concurrency_control" section.

Ft_file_lock

enum    Ft_file_lock {
FT_NOT_REQUIRED = 0,
FT_SHARED = 1,
FT_EXCLUSIVE = 2,
FT_NO_ACCESS = 3
};

Ft_file_lock enumerates the type of locks on a file. It is the enumerated type for values in struct Ft_concurrency_control. For example, if you want to be able to read a file, but you do not want other users to be able to, set the concurrency_control.read lock to FT_EXCLUSIVE.

File Action Lock Set by Ft_file_lock

Owner May Perform The Action

Others May Perform The Action

Not Required

No

Yes

Shared

Yes

Yes

Exclusive

Yes

No

No Access

No

No

Rules for Ft_concurrency_control

  • You may wish to set concurrency control to NULL wherever it exists as a parameter. This way, the responder uses its own default values. HP-UX responders use the defaults specified in the NBS Phase III agreements. The values used by a responder during the open regime are returned in the inout_dcb of the ft_open() and ft_fopen() calls.

  • If you use concurrency control (concurrency control is not NULL), you must specify a lock for each file action.

  • For those actions that are available (because you requested them in the requested_access parameter), the applicable locks are FT_SHARED and FT_EXCLUSIVE.

  • For those actions not available (because you did not request them in the requested_access parameter), the applicable locks are FT_NO_ACCESS and FT_NOT_REQUIRED.

  • The ft_open() concurrency control must be identical to—or more restrictive than—the ft_select() concurrency control; it may not be less restrictive

    CAUTION: When a system has an NFS-mounted file system , two different files can have the same device id and inode number. If both are used by FTAM concurrently, the locks applied to one file could interfere with a select or open operation on the other file.

    Furthermore, files on NFS-mounted file systems are visible on more than one host. Therefore, it is possible for FTAM to have locks on the same file from two different hosts. While each host may believe it has exclusive access to the file, in fact both hosts have concurrent access.

Table 3-1 Concurrency Control: Default Settings

In the SELECT regime:

For actions not set in the requested_access parameter, corresponding locks default to:

For each action set in the requested_access parameter, if the action is read or read_attribute, the corresponding lock defaults to:

For each action set in the requested_access parameter, otherwise, the corresponding lock defaults to:

Not Required

Shared

Exclusive

 

In the OPEN regime:

By default, all locks in the OPEN regime are set to the lock value for the current SELECT regime, either the defaults (above) or user-selected.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997 Hewlett-Packard Development Company, L.P.