develooper Front page | perl.perl5.porters | Postings from March 2003

[PATCH] readdir_r for VMS (was Re: [PATCH] configure.com: sig_num, etc.)

From:
Craig A. Berry
Date:
March 20, 2003 21:04
Subject:
[PATCH] readdir_r for VMS (was Re: [PATCH] configure.com: sig_num, etc.)
Message ID:
3E7A9D28.1040706@mac.com
Thanks to those who replied to my query about readdir and thread safety.
I've dug around a bit, read the POSIX spec for readdir_r, and come up
with the implementation in the attached patch. It basically just adds a
mutex gizmo to the directory stream structure and puts a lock on it
while calling the ordinary readdir and assigning return values. All
tests pass with a threaded build of this on top of maintperl@19035
(though they did before the patch as well).

To really stress test this with multiple threads going after the same
directory stream I'd need an SMP machine to test on, which I don't have.
But I think we are at least somewhat safer than we were before.

The affected files are:

configure.com
vms/vms.c
vms/vmsish.h





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About