Re: how to get the thread

Peter Halacsy <[email protected]> Sun, 27 Jan 2008 20:33:38 +0100
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <[email protected]>
Gerd Stolpmann wrote:
> Am Sonntag, den 27.01.2008, 19:54 +0100 schrieb Peter Halacsy:
>> Gerd Stolpmann wrote:
>>> Am Sonntag, den 27.01.2008, 18:02 +0100 schrieb Peter Halacsy:
>>>> hi,
>>>>
>>>> i'm using ocamlnet to download a lot of pages with a pipeline with the 
>>>> size 200. I'd like to open as many files as many thread I use. But in 
>>>> the callback function I don't know which thread executes the current codes.
>>>>
>>>> Do you have any suggestions?
>>> I don't understand. Ocamlnet does normally not use threads to achieve
>>> parallelism.
>>>
>>> So the answer: You know the thread, because it is always the same.
>>>
>> how does ocamlnet achieve parallelism?
>> If I add two request to the pipeline, are these executed in sequence?
> 
> No, they are executed in a multiplexed manner, using the select syscall.
> 

> But requests to different IP addresses are always handled in parallel.
>

I see. So there is only one thread.

thanks.

Other question. If I have a stream of (url, ip address) tuple, how could 
I add this information to the request? I decided to use an external 
program (adnshost) to resolve host names.

peter


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/