Using executeShell in multiple thread causes access violation error

Minas Mina via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 13 02:46:24 PDT 2015


I have written a script that visits all directories in the 
current directory and executes a command. In my case, "git pull".

When running the script serially, everything is fine. All git 
repositories are pulled.

But I'd like to pull multiple repositories in parallel to speed 
things up.
So I've changed my loop
from foreach(entry; dirs)
    to foreach(entry; parallel(dirs))

After a while that the program is running I get:
std.exception.ErrnoException at std\stdio.d(638): Could not close 
file `HANDLE(C0)'
  (No error)
----------------
0x00411E5C
0x0040B8AB
0x0040A146
0x00402288
0x00403A99
0x00413B95
0x004095FC
0x00439AA0
0x770992B2 in RtlInitializeExceptionChain
0x77099285 in RtlInitializeExceptionChain
object.Error@(0): Access Violation
----------------
0x00439429
0x0043A277
0x00411ECD
0x763A9B2C in GetFileAttributesW

Here is the code: http://pastebin.com/Tk0TBGxs


More information about the Digitalmars-d-learn mailing list