Building an RFC 1086 simulator using ithreads

By Philip Newton (‎pne‎) from London.pm
Date: Thursday, 24 July 2003 15:10
Duration: 20 minutes
Language:



At work, we wanted to change over an application written in C++ (and
some C) to from an X.25 connection to one running over an RFC 1086
device (TCP-to-X.25 bridge). Since we weren't sure which hardware
would be going to be used, I had to write a simulator in software in
order to test my code.

RFC 1086 connections need three TCP/IP connections, so the simulator
had to handle multiple connections simultaneously. I did not
particularly want to fiddle around with select(), and fork() would be
difficult, too, since the connections have to share data shortly after
startup, which would mean IPC, which I wasn't too keen on, either.

Then I thought about whether I could do this with Perl, and I
remembered ithreads. I recompiled Perl with ithreads enabled, had a
look through the documentation, and off I went, using shared scalars
and queues to share data and semaphores to control access to STDOUT
(for logging)!

This talk will explain how I did it.


Template talk/show last modified at 12:26:25 27-Jul-2013
All content copyright © 2003 Yet Another Society, Inc.
for any question about this site or YAPC::EU 2003, mail to <yapc-help@mongueurs.net>.
XHTML and CSS validation.