EExternalException at address 7C964ED1 in module Nt.dll in a multithreaded application

Posted on 2006-03-21
Last Modified: 2008-01-09
Hello Experts,

I made an application that spiders the web and indexes pages ... more like a search engine indexer.

The App uses winsock directly and threads created using BeginThread function ....  everything works fine for about 5 hours of running .. after wich it rasies the EExternalException.

I use blocking sockets with select so i only read when there is to read data.
I protect any global vars using critical sections ..
I recently downloaded EurekaLog .. and i'm currently evaluating it.. using Eureka .. it sais that the exception was rased at multiple lines in my code... one wich is at  the CriticalSection ( at the Enter ) and another one at the exit of the critical section.

I tried everything i know there is to try .. and no result... I hope the fact that i do not have Delphi Updates is not the reason .... I know there is an RTL update ... please someone guide me towards a solution ... i'm really stuck !

BTW.. I use Delphi 6 , WinXP Home edition with all windows updates.

Thank you
Question by:iulianclaudiu
    1 Comment
    LVL 1

    Accepted Solution

    Things to try:

    - Use a class derived from TThread instead of BeginThread
    - Replace global variables that are specific to one thread with thread-local variables (see threadvar in online Help).
    - Use synchronisation objects defined in Syncobjs unit, e.g. TCriticalSection.Acquire instead of EnterCriticalSection etc.
    - Call ExitThread before leaving thread function

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now