🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Getting a thread's state and CPU utilization

#2714
From: Bob Gonder
Date: Sun, 14 Jan 2007 19:46
20 lines
1840 bytes
Dennis Jones wrote:

>thread terminates.  So if it is not signalled, all I know is that it hasn't 
>terminated -- but I want to know whether or not the thread is in a wait 
>state (waiting on a synchronization object).

And for that part, I had suggested adding a thread-data flag that you
would set before and clear after going into wait-states.

> Unfortunately, I can't detect dead-lock this way,

dead-locks should never happen.
My own 2 rules are:
Always lock in the same order
	Don't lock a,b in one place then b,a in another.
Always unlock in the exact opposite order (FILO).
	Don't place a second lock at the same level until the first is
released.

Oh, and #3...don't lock without a good reason.
Technical Details
Message-ID: <up0lq2hp43a79vr8hdd05299c556be7bc8@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45a9e77e$1@newsgroups.borland.com> <999kq2l4vmj0mq60qde1gvpcom1l4arf8a@4ax.com> <45aa5fbf$1@newsgroups.borland.com> <45aa675f$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2c2b36b510895e0f
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Getting a thread's state and CPU utilization
Date: Sun, 14 Jan 2007 11:46:04 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <up0lq2hp43a79vr8hdd05299c556be7bc8@4ax.com>
References: <45a9e77e$1@newsgroups.borland.com> <999kq2l4vmj0mq60qde1gvpcom1l4arf8a@4ax.com> <45aa5fbf$1@newsgroups.borland.com> <45aa675f$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 71.0.33.18
X-Trace: newsgroups.borland.com 1168803946 71.0.33.18 (14 Jan 2007 11:45:46 -0800)
Lines: 23
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail