www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/10/23/10:38:46

Message-Id: <4.3.1.0.20001023101622.00af2d10@pop5.banet.net>
X-Sender: usbanet DOT farley3 AT pop5 DOT banet DOT net
X-Mailer: QUALCOMM Windows Eudora Version 4.3.1
Date: Mon, 23 Oct 2000 10:39:14 -0400
To: djgpp-workers AT delorie DOT com
From: "Peter J. Farley III" <pjfarley AT banet DOT net>
Subject: Re: New versions of perl require "flock" or working "fcntl(fh,
F_SETLK/W,...)"
Cc: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
In-Reply-To: <Pine.SUN.3.91.1001023134006.13851F-100000@is>
References: <4 DOT 3 DOT 1 DOT 0 DOT 20001022143136 DOT 00b03d60 AT pop5 DOT banet DOT net>
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

At 01:40 PM 10/23/00 +0200, Eli Zaretskii wrote:
<Snipped>
 >`flock' can certainly be implemented using the DOS file-locking
 >functions, at least for some of the features supported by `flock' on
 >Unix.  It's only a question of someone sitting down and coding it.
 >(If you do that, please also add the corresponding functionality to
 >`fcntl'.)
 >
 >Note that, apart of `_dos_lock', there's also `lock', that does
 >similar things.

But "lock" just calls "_dos_lock", which issues INT 21/AH=5C, which 
requires SHARE in plain DOS, if I'm reading Ralf Brown's list 
correctly.

 >> I realize this leads to problems in plain DOS when
 >> no SHARE.EXE is loaded, but a documented requirement to load
 >> SHARE.EXE to use the new perl functions or to use perl's "flock"
 >> emulation (as well as those functions of "fcntl", of course) would
 >> be OK with most folk, wouldn't it?
 >
 >In general, I won't like telling people to load SHARE.  SHARE is 
evil;
 >see section 9.7 of the FAQ for one aspect of that evilness.
 >
 >Are you sure you really need SHARE.EXE on plain DOS?  Assuming 
there's
 >only a single program running at any given time (give or take nested
 >programs), why would you need that?

My reading of Ralf Brown's list may be incorrect here, but I think 
INT21/5C will return an error unless SHARE or some network providing 
the "advisory lock" function is loaded.  Am I wrong about that?

 >More generally, perhaps it would be a good idea to explain to Perl
 >non-users, such as myself, what does this "Storable" for persistent
 >objects do, to put this discussion into a proper context.

Well, I don't claim to understand the gory details myself, but the 
basic idea is stated in the perl "pod" description:

"The Storable package brings persistency to your perl data structures
containing SCALAR, ARRAY, HASH or REF objects, i.e. anything that can 
be
convenientely stored to disk and retrieved at a later time."

(Mis-spellings not mine, pasted verbatim.)  The functions of this 
extension that fail are "lock_store" and "lock_retrieve", which each 
perform an "flock" before storing or retrieving, respectively.  Other 
functions of the package do not fail under DJGPP, only these two.  The 
package can be used without these two functions, unless you need the 
locking functionality for a networked application.

Any further advice you could give on adding this functionality to DJGPP 
would be greatly appreciated.  In the meantime, I have submitted a 
patch to p5p to avoid the problem (give a warning message and return 
the perl undefined value) in those two package functions, and not to 
test them in the perl "make test" step.
---------------------------------------------------------
Peter J. Farley III (pjfarley AT dorsai DOT org OR
                      pjfarley AT banet DOT net)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019