microsoft / verona-rt

The runtime for the Verona project
MIT License
25 stars 14 forks source link

Fixing acquiring a cown multiple times. #30

Closed lukecheeseman closed 9 months ago

lukecheeseman commented 1 year ago

Requesting the same cown multiple times in a when was creating a behaviour that wouldn't run.

This would also block any subsequent happens after behaviour for the cowns invloved.

The DAG doesn't need multiple entries for the same behaviour on a cown and we need to also ensure the count down latch is correct.

When constructing the initial array of requests, they are sorted and uniqued.

lukecheeseman commented 1 year ago

@mjp41 suggested an alternative that i'll look into to.

In brief, rather than sorting and uniqueing (which is quite expensive for a use case we don't expect very often), we can use the sorted collection of cowns that appears later in the runtime and chain together repeated requests to decrement the execution count there.

mjp41 commented 11 months ago

Now done in #34