🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Threads Threads Threads

#12533
From: Colin Maharaj
Date: Mon, 01 Dec 2003 23:20
24 lines
1785 bytes
Hi all,
I have Thread A with resources and Thread B with resources.
I instantiate thread A then thread B and thread B is trying 
to use resources in thread A.

What is weird is on my 1 Ghz machine every thing is great 
but on my 2.4 Ghz machine I get access violations.

I then try something, I declare a static bool called IsUp
and declare it false and at the last line of the constructor 
of thread A, I say IsUp = true;

I then place... 
if (IsUp==false) return;
In the member functions of the thread and 
now I get no problems in my 2.4 Ghz machine.


QUESTION:
Is it possible that thread B is trying to access
resources and functions on thread A while thread 
A's constructor is still running? Even though 
thread B's constructor has finished and was 
called after thread A?
Technical Details
Message-ID: <3FCBCCB2.C4C79E81@cablenett.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed.freenet.de!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,e26628fb95e98199,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-12-01 15:25:52 PST
Message-ID: <3FCBCCB2.C4C79E81@cablenett.net>
Date: Mon, 01 Dec 2003 19:20:18 -0400
From: Colin Maharaj <cbm@cablenett.net>
Reply-To: cbm@cablenett.net
X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Threads Threads Threads
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 196.32.37.78
X-Trace: newsgroups.borland.com 1070320849 196.32.37.78 (1 Dec 2003 15:20:49 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed.freenet.de!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail