xcherryio / xcherry

server and main repo of xCherry project
Apache License 2.0
26 stars 1 forks source link

Potentially improve perf(lock contention) #77

Open longquanzheng opened 10 months ago

longquanzheng commented 10 months ago

Currently we always lock the prc exection first, as a pattern to avoid dead lock.

E.g. processing a timer task could potentially involving localQueue updates which stored in prc execution. However, in some (or maybe many) cases, an state execution will only have timer, without any localQueue. This means locking/selecting the prc execution will be wasteful.

A probly better idea:

So the better patten is, within a transaction: