On 19/01/2015 13:43, Pavel Dovgaluk wrote:
> > For example, why can't replay_run_event (or something
> > that it calls) take the replay lock locally, when it writes to the log?
>
> replay_run_event can take the lock. Suppose that it writes data 'A'.
> replay_run_event itself corresponds to some event 'E'.
> We expect that the following sequence of the events should occur: 'E', 'A'.
> But if something will be written to the log between 'E' and 'A' then
> replay_run_event in replay mode will stuck, because it will not see its data 
> 'A'.

It would be easier if you pointed me to actual code in the series.  But
this doesn't seem impossible to fix by atomically writing the 'E' and
'A' in the same critical section.

This is for example how QMP events are thread-safe: it just adds the
JSON string corresponding to the QMP event atomically in monitor_puts.

Paolo

Reply via email to