Subject Re: i need your opinion...
Author Adam
--- In, "Ann W. Harrison"
<aharrison@i...> wrote:
> Adam wrote:
> >
> > To answer your direct question, I suppose you could write a UDF that
> > sleeps the thread for a set time rather than waste clock cycles which
> > may be important in sorting etc.
> Don't do that! If the sleeping process is holding a critical lock it
> will stop the system. For example, most processes have a read lock on
> the most recent TIP. Unless they can release that lock, it will keep
> other transactions from committing. A read lock on the header page
> will keep other transactions from starting. A read lock on an index
> page stops inserts and updates.
> Let me reiterate, first, be sure you understand the problem. In my
> experience, Firebird tends to be CPU bound more often than I/O bound.
> That's another issue and one that we are addressing - Arno took a
> great step in that direction with the index changes - but for 1.5,
> CPU is a more critical resource than disk.

A very good point Ann. I wasn't suggesting he did that, but it has got
to be preferable to sleep the thread for one second than to use up CPU
cycles for one second. Neither is a good idea though considering the
TIP read lock issue. I was thinking about deltas and garbage as the
main reason you would not want to hold the transactions open for
unneccessary lengths of times (which would make it a bad idea anyway).