Article View: borland.public.cppbuilder.nativeapi
Article #1827Re: Thread safety
From: Colin B Maharaj
Date: Tue, 12 Jun 2007 12:28
Date: Tue, 12 Jun 2007 12:28
48 lines
2321 bytes
2321 bytes
Well Alex, I removed all of the sprintf calls in my code and not an error. When I started using code guard / memproof on my initial code I was getting thousands of errors. The programs is a multi TCP polling client creating 10 threads to poll data from data buffers. Initially I tried to rewrite some indy routines for string sending and receiving without the use of AnsiStrings and this seem to work but there were still some errors (hundreds). I then decided to remove sprintf and all went very well. The only problem I had was code guard crashing. But when I recompiled without code guard - no problems at all (so far). I even reintroduced, in some of my code the use of AnsiString with Indy routines and still no problems. As a responsible programmer, I will have to create a test program to illustrate. (probably later on this week). But this is my experience. [C++ Builder 6.0 Enterprise with Update 4] [Indy 9.0.50] [Win XP Professional SP2 - with all updates] [AMD Athlon 64 X2 Dual Core] [Core Processor 4200+] [2.21 Ghz, 2.00 GB of RAM] [DEP off - conflicts with Builder] [Avast Antivirus] AlexB wrote: > Colin B Maharaj wrote: > >> 2. I definitely learn't that sprintf is unsafe > > Really ? How you have determined it ? > > Can anybody else confirm it ? >
Technical Details
Message-ID:
<466e9171@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<466e7571$1@newsgroups.borland.com> <466e89d8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,7fa2ebca6213823d X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 12 Jun 2007 08:28:32 -0400 From: Colin B Maharaj <noreply@myhost.com> User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Thread safety References: <466e7571$1@newsgroups.borland.com> <466e89d8$1@newsgroups.borland.com> In-Reply-To: <466e89d8$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000748-3, 06/11/2007), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 190.58.14.113 Message-ID: <466e9171@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1181651313 190.58.14.113 (12 Jun 2007 05:28:33 -0700) Lines: 48 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail