🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13637

Re: Thread questions

#13637
From: Jonathan Starr
Date: Wed, 01 Oct 2003 17:36
41 lines
2491 bytes
I should have mentioned that I am seeing these behaviors with Code Guard on.

Jonathan Starr wrote:

> 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: <3f7b0e99@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-09!supernews.com!newsfeed.news2me.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f7b0c4e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,daa80f767a159c0c,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-01 10:40:12 PST
Date: Wed, 01 Oct 2003 13:36:17 -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: Re: Thread questions
References: <3f7b0c4e$1@newsgroups.borland.com>
In-Reply-To: <3f7b0c4e$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 66.217.148.63
Message-ID: <3f7b0e99@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1065029273 66.217.148.63 (1 Oct 2003 10:27:53 -0700)
Lines: 42
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-09!supernews.com!newsfeed.news2me.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail