Article View: borland.public.cppbuilder.database.multi-tier
Article #1869Re: multi thread problem
From: Jerry Bloomfield [TeamB]
Date: Thu, 03 Dec 1998 00:00
Date: Thu, 03 Dec 1998 00:00
37 lines
2608 bytes
2608 bytes
On Fri, 13 Nov 1998 12:40:49 +0000, "Mohr, Dirk" <dirk.mohr@fh-bochum.de> wrote: >My Problem is, that the Application sometimes works good and sometimes >have an "no controlling time behaviour" (without changing code). It >seems that NT gives the Threads Time without controll. Sometimes one of >the three Threads (not even the same) runs faster then the other >(Priority - tpNormal). At other times it seems, that one Thread blocks >the other. Your description contains no mention of databases, so your question may get a better answer in the borland.public.bcppbuilder.winapi news group than in a database related group... Having said that, the NT scheduler is a little odd in the way threads are processed. The scheduler will "round-robin" through all processes at a certain priority level, and if there is time left when that level completes, it will move on to the next priority level. After a certain amount of time that a process has not gotten any CPU time, the scheduler will give it a "priority boost" to bump it up into a priority level where it will get some CPU time to prevent starvation of processes on a busy system. If you are using any type of Critical section, or Mutex, or exclusive database activity in any one thread, the others will get blocked if your active thread gets swapped out and hasn't released that "lock" yet. I have seen this happen in an app we have which has a "low priority" thread which does nothing but delete old data from a database, while 2 other threads are adding data and updating data. When the "low priority" thread gets a lock on the table then gets swapped-out, the other threads will not be able to access the table and will block waiting on the table to be released, thus causing a form of a priority inversion on us... Jerry Bloomfield (TeamB) -- Jerry Bloomfield JersWork@wwa.com Proud Member of Inprise's TeamB "We'll do anything if you don't pay us."
Technical Details
Message-ID:
<36700bc4.8954666@forums.inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<364C28D1.167E@fh-bochum.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,8d2dc7dd36ef1d45 X-Google-Attributes: gidfcd2b,public From: JersWork@wwa.com (Jerry Bloomfield [TeamB]) Subject: Re: multi thread problem Date: 1998/12/03 Message-ID: <36700bc4.8954666@forums.inprise.com> X-Deja-AN: 418133828 Content-Transfer-Encoding: 7bit References: <364C28D1.167E@fh-bochum.de> Followup-To: borland.public.bcppbuilder.winapi Content-Type: text/plain; charset=us-ascii Organization: LSVFA - Latest Software Version Freaks Anonomous Mime-Version: 1.0 Newsgroups: borland.public.cppbuilder.database.multi-tier