[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying cl
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks |
Date: |
Tue, 13 Jan 2015 10:38:36 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 13/01/2015 10:21, Pavel Dovgaluk wrote:
>>> +/*! Reads next clock event from the input. */
>>> > > +int64_t replay_read_clock(unsigned int kind)
>>> > > +{
>>> > > + if (kind >= REPLAY_CLOCK_COUNT) {
>>> > > + fprintf(stderr, "invalid clock ID %d for replay\n", kind);
>>> > > + exit(1);
>>> > > + }
>>> > > +
>>> > > + replay_exec_instructions();
>>> > > +
>>> > > + if (replay_file) {
>>> > > + if (skip_async_events(EVENT_CLOCK + kind)) {
>>> > > + replay_read_next_clock(kind);
>>> > > + }
>>> > > + int64_t ret = replay_state.cached_clock[kind];
>>> > > +
>>> > > + return ret;
>>> > > + }
>>> > > +
>>> > > + fprintf(stderr, "REPLAY INTERNAL ERROR %d\n", __LINE__);
>>> > > + exit(1);
>>> > > +}
>> >
>> > Is this thread safe?
> It is, because order of main_loop and cpu_exec executions is protected
> by global mutex.
>
Please document exactly which globals are protected by the rr QemuMutex,
and which by the global mutex. But I think as many variables as
possible should be protected by the rr QemuMutex, for two reasons:
1) people are working on threaded TCG. While SMP record/replay is a
whole different story, even UP TCG will be multithreaded.
2) in the end it makes reviewing the code simpler.
Paolo
- Re: [Qemu-devel] [RFC PATCH v7 10/21] cpus: make icount warp deterministic in replay mode, (continued)
- [Qemu-devel] [RFC PATCH v7 09/21] replay: asynchronous events infrastructure, Pavel Dovgalyuk, 2015/01/12
- [Qemu-devel] [RFC PATCH v7 11/21] timer: fix usage of clock functions, Pavel Dovgalyuk, 2015/01/12
- [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Pavel Dovgalyuk, 2015/01/12
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Paolo Bonzini, 2015/01/12
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Pavel Dovgaluk, 2015/01/13
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks,
Paolo Bonzini <=
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Pavel Dovgaluk, 2015/01/16
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Paolo Bonzini, 2015/01/19
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Pavel Dovgaluk, 2015/01/19
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Paolo Bonzini, 2015/01/19
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Pavel Dovgaluk, 2015/01/19
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Paolo Bonzini, 2015/01/19
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Pavel Dovgaluk, 2015/01/19
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Paolo Bonzini, 2015/01/19
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Pavel Dovgaluk, 2015/01/19
- Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks, Paolo Bonzini, 2015/01/19