cURL / Mailing Lists / curl-library / Single Mail

curl-library

Access violation with multi threads

From: Zhen Wang <writewang_at_hotmail.com>
Date: Wed, 20 Nov 2002 00:28:39 +0800

Hi all, I am confused because my program goes well with single threads but
occurs access violation while using multi-threads. Since the processes are
the same, I dont know why this happened. The following is a fragment of my
program. If I use the code in /* */, everything is OK. But the program will
crash if I use the lines begin with //. Anyone knows the reasons? Thanks in
advance.
Best regards,
Wang

void CServerList::Get()
{
/* CServer* pServer;
        while(pServer=GetServerReadyToGet()){
                pServer->Get();
        }
*/

// for(int i=0; i<5; i++){
// pThread[i] = AfxBeginThread(StartGet, this);
// }
}

UINT StartCraw(LPVOID pParam){
        CServerList* pServerList = (CServerList*)pParam;
        CServer* pServer;
        while(pServer=pServerList->GetServerReadyToGet()){
                pServer->Get();
        }
        return 0;
}

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing
your web site with SSL, click here to get a FREE TRIAL of a Thawte
Server Certificate: http://www.gothawte.com/rd524.html
Received on 2002-11-19