W3C home > Mailing lists > Public > www-lib@w3.org > April to June 1999

Requirements for multithreading?

From: Koch, Kevin <Kevin.Koch@compaq.com>
Date: Wed, 23 Jun 1999 12:31:08 -0400
Message-ID: <9996FB0C6AB3D111B9FB0000F81E38A204D1072C@lkgexc1.bb.dec.com>
To: www-lib@w3.org
I'm writing a load generator that forks multiple threads per client, each of
which loads files from the server under test.  Do I have to be aware of or
do anything special to run the libwww code in a multithreaded environment?
Thanks.

In case it matters, here's an excerpt of the code:  

int
getftp(char *loc, NETPORT port, char *url, rqst_timer_t *timer)
{
    HTRequest	*request = NULL;
    HTChunk	*chunk = NULL;

. . .
    char	fullpath[MAXPATHLEN];
    strcpy(fullpath, "ftp://");
    strcat(fullpath, loc);
    strcat(fullpath, url);
. . .
    HTProfile_newPreemptiveClient("getftp", "1.0");
    HTPrint_setCallback(printer);
    HTTrace_setCallback(tracer);
. . .
    request = HTRequest_new();
    HTRequest_setOutputFormat(request, WWW_RAW);
    HTRequest_addConnection(request, "close", ""); 
    if (url) {
       char	*absolute_url;
       char	*cwd 	= HTGetCurrentDirectoryURL();
       absolute_url	= HTParse(fullpath/*url*/, cwd, PARSE_ALL);
       chunk		= HTLoadToChunk(absolute_url, request);
       HT_FREE(absolute_url);
       HT_FREE(cwd);
    }

    if (chunk) {
        bytesread	= HTChunk_size(chunk);
        headerlen	= 0;
    }

    HTRequest_delete(request);
    HTProfile_delete();
. . .
Received on Wednesday, 23 June 1999 12:32:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:29 GMT