macports fetch suggestion

Ryan Schmidt ryandesign at macports.org
Mon Sep 12 07:16:38 PDT 2011


On Sep 12, 2011, at 08:24, Arno Hautala wrote:

> I'm not that familiar with base either, but I think one improvement
> would be finer grained locking. It seems right now that only one
> install or fetch command can be run at a time. But, it would seem to
> me that these could be independently locked. You don't want to build
> with multiple threads, but it should be fine to build one task, while
> another task fetches. One issue could be if a database is updated
> after the fetch which impacts a subsequent build task that has already
> read the database. There's still probably plenty of race conditions
> that would need to be examined, but finer grained locking might be an
> easier step towards the goal.

The existence of any locking at all in MacPorts is relatively recent; the ticket about improving fetch predates MacPorts locking by many years, so any work on locking wouldn't really address this issue.

Yes, I'd love it if our lock weren't so coarse. I railed against locking when it was initially implemented. I still hate it because it makes me less efficient with MacPorts. But it does prevent our users (and occasionally me) from encountering odd issues, and I love reducing our support burden, so on balance I'm in favor of it. And making it more fine-grained would be great, if anyone wants to work on it.

Fixing our coarse lock to make it work again would be great too: https://trac.macports.org/ticket/31056




More information about the macports-dev mailing list