Subject Re: [IB-Architect] New feature request (thread priority)
Author Kay Schubert
Hello Toni,
do you understand that IB executes queries as a whole ? Only one query
at a time will be processed, and all other queries are blocked until the
current query completes. That means if IB starts to process a 10 second
query, all other queries have to wait until this query completes,
regardless of their thread priority. Lowering the priority of this
10-second query making it a 12 second query means that all other queries
incoming while this query is processed have to wait 2 seconds more
before getting a chance to start. In other words: query execution is a
atomar process, so all queries are serialized. At the moment in fact IB
is a single task system, which probably doesn't gain any advantage in
different prioritized queries.

Hth, Kay

Toni Martir wrote:
>
> > This is the bane of operating system scheduling algorithms. The problem
> > is this: A high priority threads get stuck behind a low priority thread
> > in a busy system never gets scheduled, and is effectively blocked. Unless
> > a thread can inherit the priority of a thread it is blocking, you are
> > likely to be very disappointed in the results.
> >
>
> I understand this, for example with one computer with NT File Server and
> Interbase installed, when I set high priority for Interbase Server, the file
> server service blocks, until Interbase is idle.
>
> So is a responsibility to the programer to set high priority only in threads
> that takes very little time and are not very frequent to block other threads
> (querys) for a long time. Think about a system executing 5% CPU time in high
> priority threads and 60% other priority threads. The problem is when a long
> proces has high priority, but for example Win32 has two priority levels to
> try avoid this problem (SetPriorityclass and Setthreadpriority).
> As you say if always exits high priority thread, the low priority threads
> are never executed, but this is what we want (now background garbage
> collection does this?). I want the time critical query to be executed before
> a analitic query, the analitic query will be blocked little time because the
> high priority threads are short and not very frequent.
>
> Note:
> Take care that bloquing of low priority thread is not 100% effective because
> if the high priority thread does I/O, a quantum time is donated to other
> thread, if there is no CPU demand of high priority threads, the low priority
> thread takes the CPU while high priority threads waits for I/O result.
>
> To unsubscribe from this group, send an email to:
> IB-Architect-unsubscribe@onelist.com