Re: how to get the thread

Gerd Stolpmann <[email protected]> Sun, 27 Jan 2008 20:11:20 +0100
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <[email protected]>
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.

Actually, there is some serialization if the requests are sent to the
same IP address, but this is intentional. Ocamlnet only opens a limited
number of connections to every IP address, and if this limit is
exceeded, you see serialization. The idea is to protect remote hosts
from being overloaded by a single client.

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

Gerd


> 
> 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/
> _______________________________________________
> Ocamlnet-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel
> 
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
[email protected]          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------



-------------------------------------------------------------------------
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/