I'll take a look once I get down from the mountains. What little time
I'm not skiing I'm hacking on commons-compress right now. Remember
that the general multi-threaded contract of maven is simple and clear;
unless clearly stated a mojo is not allowed to call back on the maven
core model objects on a different thread. Only the thread that invoked
the mojo is allowed to write to shared state.

I can't really see us leaving this model any time soon, plugin code
should really obey this contract. So thread handoffs should be within
the mojo. This means that within core we have clear ideas of what code
actually sees multiple threads; hopefully :)

Kristian

2014-12-30 14:44 GMT+01:00 Tibor Digana <[email protected]>:
> An excellent operation is CAS (Compare and Swap/Set). This would mean that
> POJO would have getters which return "unmodifiableCollection", and new CAS
> operations, for instance for the project dependencies.
>
> The new method would be then:
>
> public boolean casDependencies(Collection<Artifact> original,
> Collection<Artifact> modified).
>
> The usecase would be then in whatever plugin:
>
> Collection<Artifact> newDeps;
> do {
> Collection<Artifact> deps = project.getDependencies();
> newDeps = copyAndModifyDependencies( deps );
> } while ( !project.casDependencies( deps,  newDeps ) );
>
> Every injectable POJO object will share single guardian lock object per POM
> project (plugin has no notion) and use it in CAS operations (maven-core
> impl).
>
>
>
> --
> View this message in context: 
> http://maven.40175.n5.nabble.com/Maven-Commit-3b671d07340b002e13775883d09e7f7e0d9a3c49-tp5821660p5821741.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to