From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,URI_HEX autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c22949b5ebf3505f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-09 07:42:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!212.97.175.23!not-for-mail From: Jano Newsgroups: comp.lang.ada Subject: Re: [OT] Two sockets questions Date: Fri, 9 May 2003 16:42:50 +0200 Message-ID: References: NNTP-Posting-Host: 212.97.175.23 X-Trace: fu-berlin.de 1052491364 20216023 212.97.175.23 (16 [49872]) X-Newsreader: MicroPlanet Gravity v2.50 Xref: archiver1.google.com comp.lang.ada:37107 Date: 2003-05-09T16:42:50+02:00 List-Id: tmoran@acm.org dice... > I'm curious why you want to use non-blocking sockets. It's generally > easier in Ada to use multiple tasks and let individual tasks block. Leaving curiosity aside :)? Actually, blocking tasks is my preferred option (the one I knew previously and thus find easier). However, I'm implementing a p2p application (summary at http://agio.sourceforge.net) which likely will need maintaining hundreds or thousands of open connections. Also, checking for alive hosts quickly is very interesting (hence the connect question). Moreover, it's probable these hosts that I must check come in bursts. I'm a bit afraid of using so many (say two thousands) tasks (are they really that light? What computer is necessary for that number? I have a pretty decent one, but...) but really I haven't past experiences about so many threads. However, as I've never seen an application so task intensive, I've think that that is for some reason (my httpd apache uses 253 and is the most I've seen). Other ideas I've considered is using selectors and group sockets in tasks (on how many sockets can wait a selector?) and, finally, use non- blocking sockets and use the lowest possible number of tasks. However, for connect, I can't use select. P.s: About how many bandwidth consumes a TCP connection for keep-alive? :) bonus question I've just think. -- ------------------------- Jano 402450.at.cepsz.unizar.es -------------------------