The function
setup-atomic-funcall
sets up a funcall which will be executed atomically with respect to any other calls which were also set up by
setup-atomic-funcall
.
The call causes the execution of the form
(apply (car function-and-arguments )
(cdr function-and-arguments ))
some time after the entry to
setup-atomic-funcall
. The call may happen before
setup-atomic-funcall
returns, and it is expected that normally this is what will happen. However, it may be delayed for an indefinite period, but normally this period is short (milliseconds). The execution occurs atomically with respect to other calls that were set up by
setup-atomic-funcall
.
The call should be short, because otherwise it will delay all the other calls. If an error occurs during the call, the atomicity is no longer guaranteed.
setup-atomic-funcall
is useful when a process needs to atomically tell another process to do something, but does not need to wait for it to finish.
setup-atomic-funcall
causes less congestion than using a lock, and so is more efficient for locks that may cause congestion. compare-and-swap and atomic-exchange operations will be faster.
LispWorks User Guide and Reference Manual - 21 Dec 2011