Subject Re[4]: [firebird-support] sweep start & running
Author Dmitry Kuzmenko
Hello, Nick!

Monday, January 14, 2013, 6:39:33 PM, you wrote:

NU> I'm think of something like this:
NU> process A starts a transaction & holds it open, holding the transaction
NU> counter
NU> (time & transactions pass)
NU> process B starts a transaction, sees gap > 20000 & initiates sweep
...
No, completely.

Process A starts a transaction, engine checks Next, OAT, OST, etc,
and if there is a sweep gap greater than sweep interval, starts sweep.
This happens at the start of transaction, and this operation
is not parallel.

So, when next transaction will start, auto-sweep already will be active,
and will not start second time.

And, transactions does not "holding the transaction counter".

Have you heard about windows function InterLockedIncrement?
Transaction start is like this.


NU> On 14 January 2013 14:30, Dmitry Kuzmenko <kdv@...> wrote:

>> **
>>
>>
>> Hello, Nick!
>>
>> Monday, January 14, 2013, 5:52:49 PM, you wrote:
>>
>> NU> if 2 processes both see a gap > 20000 will that result in 2 sweeps
>> running
>> NU> at the same time?
>>
>> transaction start is serialized, i.e. no 2 transactions can start at
>> the same time. So, auto-sweep can not run 2 times at once.
>> Only first transaction start, that will discover "sweep interval",
>> will initiate auto-sweep (if it is not turned off by sweep interval =
>> 0).
>>
>> --
>> Dmitry Kuzmenko, www.ib-aid.com
>>
>>
>>






--
Dmitry Kuzmenko, www.ib-aid.com