Hi,
GC was developed in a way that it should support to run a gc while the repo is modified by other threads processes. But I am not sure whether there are certain cases during parallel gc's on the same repo which could lead to problems. To be honest, I would avoid parallel gc's.
But in theory the problem is not so difficult as it looks in the beginning. The JGit GC operation is doing two things:
1) repack: find all objects referenced (recursively) by all exisiting refs/reflogs/index and try to write them all in a single new packfile. The new packfile gets a name which is derived from the ids of all the objects contained in the pack. If two repacks run in parallel but the second repack was started on a different repositorystate as the first then they will very likely write into two indedpendent packfiles. The previous packfiles can be deleted afterwards
2) prune: find all loose objects which are now unreferenced and which are old enough (default is 2 weeks, see config param gc.pruneExpire)
On the first glimpse these steps could run in parallel, or?
Ciao
Chris