T.R | Title | User | Personal Name | Date | Lines |
---|
3255.1 | more info reqd | RDGENG::SNYDER_P | The speed of time is best set to 1sec/sec | Fri Mar 14 1997 10:24 | 50 |
| To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Digital ASAP call 21272 - IBS Dr. Sommer
In-Reply-To: Your message of Fri, 28 Feb 97 10:38:33 +0000.
<[email protected]>
Date: Mon, 03 Mar 97 11:03:29 +0000
From: "Pauline Snyder" <pauline>
X-Mts: smtp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: Pauline Snyder Loc: REO/F8 DTN: 830 4096
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for the attention of Andreas Sohn
Andreas,
Thank you for your ASAP support call on Digital UNIX remote/local file
locking. Your call has been assigned to me so please e-mail me direct
while we investigate.
Can you give me a bit more information to help me find out what is
happening, please.
I presume you are using flock to lock the file with LOCK_SH. Are you
also using LOCK_NB ? Would this be appropriate ? Just for interest
why are you locking the shellscript file ?
When you say 'the performance is very slow!' do you mean the
performance of the locked script or the performance of the locking
application or the performance of the system in general ? Can
you say how much slower, e.g. 1.1x , 10x, or 100x ? Does this apply
when the application and script are on the same machine or only when
they are remote ? Is the network connection tcp/ip ?
Any relevant code would be of interest.
Best regards,
Pauline
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pauline Snyder Software Partner Engineering, Reading
Digital Equipment Company Ltd. ASAP Technical Support
Digital Park, Worton Grange
Imperial Way email: [email protected]
Reading RG2 0TE tel: +44.118.920.4096
England fax: +44.118.920.4146
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=======================================================================
|
3255.2 | further info from customer | RDGENG::SNYDER_P | The speed of time is best set to 1sec/sec | Fri Mar 14 1997 10:25 | 180 |
| From: [email protected]
Received: from emout02.mail.aol.com (emout02.mx.aol.com [198.81.11.93]) by
server21.digital.fr (8.7.5/8.7) with ESMTP id IAA02888 for
<[email protected]>; Tue, 4 Mar 1997 08:28:52 +0100 (MET)
Received: (from root@localhost)
by emout02.mail.aol.com (8.7.6/8.7.3/AOL-2.0.0)
id CAA04774 for [email protected];
Tue, 4 Mar 1997 02:21:33 -0500 (EST)
Date: Tue, 4 Mar 1997 02:21:33 -0500 (EST)
Message-Id: <[email protected]>
To: [email protected]
Subject: Problem with remote file locking
Pauline,
Thanks for you email. Here are some details you want to know.
I am using the function fcntl with F_RDLCK.
The application that is lock the script file is an editor. The locking is
used so other editor session can find out that a file is in use.
The performance of the shellscript is very slow (factor 10 or greater). If i
edit a shellscript with the editor and start the shellscript then this
script is very slow.
If i end the editor session the shell script is still very slow. If i copy
the shellscript it works ok. This is only if the shellscript is on a
mounted filesystem.
I hope that i can help you to find out my problem with this informations.
With best regards
Andreas
Here is the code of the function which lock's the file:
/*===========================================================================*
/
/* lockFile-Routine (c) by ibgs
*/
/*===========================================================================*
/
/* Autor : A. Sohn
*/
/* Datum : 27.09.1995
*/
/* Aufgabe : lockFile erzeugt auf die uebergebene Datei ein Write-Lock.
*/
/*
*/
/*===========================================================================*
/
/*
*/
/* Rueckgabewert: Der uebergebene oder neu geoeffnete Datei desscriptor.
*/
/*
*/
/*===========================================================================*
/
/*
*/
/* Parameterbeschreibung:
*/
/*
*/
/* *cpFileName: ist der Dateiname einer Datei, die gelockt werden soll.
*/
/*
*/
/* iFileDescriptor: ist der Datei descriptor einer Datei, die gelockt
werden*/
/* soll. Der Parameter iFileDescriptor wird nur benutzt,
*/
/* wenn kein Dateiname uebergeben wird !
*/
/*
*/
/*===========================================================================*
/
/* Aenderungen Aenderungen Aenderungen Aenderungen Aenderungen Aenderungen
*/
/*===========================================================================*
/
/* Von :
*/
/* Am :
*/
/* Marke:
*/
/* Was :
*/
/*
*/
/*===========================================================================*
/
/*---------------------------------------------------------------------------*
/
/* Notwendige include-Datei
*/
/*---------------------------------------------------------------------------*
/
#include <ibgsFileMan.h>
/*---------------------------------------------------------------------------*
/
/* Funktionsanfang !!!
*/
/*---------------------------------------------------------------------------*
/
int lockFile( char *cpFileName ,
int iFileDescriptor )
{
int iFileId = -1;
#ifdef VMS
#else
struct flock flLockStruct;
#endif
/*---------------------------------------------------------------------------*
/
/* Der Datei-Descriptor der zu lockenden Datei wird bestimmt.
*/
/*---------------------------------------------------------------------------*
/
if ( cpFileName && strlen( cpFileName ) )
iFileId = open( convertUNIXtoOther( cpFileName, 0 ), O_RDWR );
else if ( iFileDescriptor > -1 )
iFileId = iFileDescriptor;
else
iFileId = -1;
/*---------------------------------------------------------------------------*
/
/* Die Datei wird gelockt.
*/
/*---------------------------------------------------------------------------*
/
if ( iFileId > -1 )
{
#ifdef VMS
#else
lseek( iFileId, 0L, 0 );
flLockStruct.l_type = F_RDLCK;
flLockStruct.l_whence = 0;
flLockStruct.l_start = 0;
flLockStruct.l_len = 0;
if ( fcntl( iFileId, F_SETLK, &flLockStruct ) == -1 )
iFileId = -1;
#endif
}
/*---------------------------------------------------------------------------*
/
/* Der Datei-Descriptor der gelockten Datei wird zurueck geliefert.
*/
/*---------------------------------------------------------------------------*
/
return iFileId;
}
|
3255.3 | that's the way it is.... | RDGENG::SNYDER_P | The speed of time is best set to 1sec/sec | Fri Mar 14 1997 10:26 | 52 |
| To: [email protected]
Cc: [email protected]
Subject: Re: Problem with remote file locking
In-Reply-To: Your message of Tue, 04 Mar 97 02:21:33 -0500.
<[email protected]>
Date: Tue, 04 Mar 97 09:32:49 +0000
From: "Pauline Snyder" <pauline>
X-Mts: smtp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: Pauline Snyder Loc: REO/F8 DTN: 830 4096
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for the attention of Andreas Sohn
Andreas,
This extract from the man page for fcntl relating to client data
cacheing is the probable explanation for the slower operation. The
[Digital] prefix means this is a Digital implementation specific note
in the man page.
[Digital] In order to maintain consistency in the network case, data must
not be cached on client machines. For this reason, file buffering for an
NFS file is turned off when the first lock is attempted on the file.
Buffering remains off as long as the file is open. Programs that do I/O
buffering in the user address space, however, may have inconsistent
results. The standard I/O package, for instance, is a common source of
unexpected buffering.
Turning off file buffering would certainly cause a significant slow down
which would continue until the script was exited even though the edit
session was terminated and is consistent with your other observations.
As a general principle Digital UNIX will tend towards caution where other
implementations may merely document that file consistency may not be
maintained across a network. What other UNIX implementations of your
software do you have and how do they compare in this respect ?
Best regards,
Pauline
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pauline Snyder Software Partner Engineering, Reading
Digital Equipment Company Ltd.
Digital Park, Worton Grange
Imperial Way email: [email protected]
Reading RG2 0TE tel: +44.118.920.4096
England fax: +44.118.920.4146
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=======================================================================
|
3255.4 | How can i change this ... ? | RDGENG::SNYDER_P | The speed of time is best set to 1sec/sec | Fri Mar 14 1997 10:27 | 23 |
| From: [email protected]
Received: from emout08.mail.aol.com (emout08.mx.aol.com [198.81.11.23]) by
server21.digital.fr (8.7.5/8.7) with ESMTP id OAA07738 for
<[email protected]>; Fri, 7 Mar 1997 14:07:28 +0100 (MET)
Received: (from root@localhost)
by emout08.mail.aol.com (8.7.6/8.7.3/AOL-2.0.0)
id IAA29937 for [email protected];
Fri, 7 Mar 1997 08:00:06 -0500 (EST)
Date: Fri, 7 Mar 1997 08:00:06 -0500 (EST)
Message-Id: <[email protected]>
To: [email protected]
Subject: How can i change this ...
Pauline,
thanks for your answer, but how can i change the file status when i end the
edit
session. In other word how must i change our locking mechanism so that this
error does not occur.
Best regards
Andreas
|