What I need to do is to have the application listening for connections
while still allowing the user to do stuff. I am using IO::Socket and since
the accept function blocks I think I have to use atleast 2 threads for
this to happen. I would love it if someone would tell me otherwise
however.

Is it safe to say that the Thread.pm module will be a safe and portable
way to do concurrency in future versions of perl? Right now I am using the
activestate perl which won't let me use threads because of ithreads or
something. Basically I want this to run well on my windows and my linux
system so should I change the perl distribution to one that includes the
Treads module? If so, which one is that?


Ryan Boder
http://www.ece.cmu.edu/~rtb

On Mon, 9 Jul 2001, Jos I. Boumans wrote:

> All depends what you really need... if you want simply to have one script
> send data to another script over a network, use IO::Socket
> it will do exactly what you want...
> however, if you're looking into threads, i can tell you that decent thread
> support for perl will (hopefully) be available when 5.8 gets released, but
> it's all a bit unsure...
> Otoh, you could look into POE, which is perl's timesliced kernel so to
> speak... you can find it at poe.perl.org, but mind you, it will take a bit
> to wrap your head around but will allow you to 'multithread' (really
> timeslicing, but with most socket connections you have time to spare) using
> perl.
> 
> i should have some sample code using sockets under POE, so if you choose
> this route, let me know.
> 
> hth,
> 
> Jos Boumans
> 
> <snip>
> 
> > Hi,
> >
> > I am very new to perl. In fact, I am trying to write my first perl app
> > ever. I would like it to do peer to peer networking. I have always been
> > a C programmer and if I wanted to do this in C I would use threads and
> > have one accepting connections and one initiating connections. Well, I
> > read that thread support for perl was experimental and you had to
> > recompile perl to include a thread.pm module. I really don't want to do
> > that since not very many people would then want to use my program. Also
> > I read that using fork was a bad idea when trying to write portable code.
> >
> > So what would be the best way to be able to both accept and initiate
> > network connections in perl? I want it to be portable. I assume some
> > kind of concurrency would be needed but then again I havce only been
> > using perl for a week.
> >
> > Thanks,
> > Ryan
> >
> >
> 
> 

Reply via email to