Article View: borland.public.cppbuilder.nativeapi
Article #13638Thread questions
From: Jonathan Starr
Date: Wed, 01 Oct 2003 17:26
Date: Wed, 01 Oct 2003 17:26
35 lines
2291 bytes
2291 bytes
I have two issues: 1. thread suspend/resume If a low-priority thread is suspended, and a high-priority thread Resumes the low-pri thread but the high-priority thread continues to run, under what cirsumstances will the low-pri thread actually begin to execute? If the high-pri thread, while continuing to run, calls a thread method of the low-pri thread to Synchronize, will that make any difference (the high-pri thread should be the UI thread, and would call the other thread's method just to avoid duplicate code or complicated flow control). Thanks in advance. PS What is happening is that the low-pri thread *appears* to begin executing at a random point while the high-pri thread is busy again. 2. locking A thread may acquire a TCriticalSection a lock multiple times before releasing it. The lock maintains a counter internally. I had thought that if a thread acquired such a lock several times and released it once, it still held it - another thread would block trying to acquire it until it was released as many times as acquired. But I am seeing a case in which a single release seems to allow another thread to acquire the lock. Comments?
Technical Details
Message-ID:
<3f7b0c4e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer01.lnd.ops.eu.uu.net!lnewsinpeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,daa80f767a159c0c X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-10-01 10:40:12 PST Date: Wed, 01 Oct 2003 13:26:30 -0400 From: Jonathan Starr <starr@belsoft.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Thread questions Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 66.217.148.63 Message-ID: <3f7b0c4e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1065028686 66.217.148.63 (1 Oct 2003 10:18:06 -0700) Lines: 36 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer01.lnd.ops.eu.uu.net!lnewsinpeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail