threads!

bronto on 2005-01-07T08:55:57

Months ago I started looking for something new and useful to learn with Perl. I took a look at all the books I have and I read less. Many things came in to mind, the most interesting of which were GUIs and threads.

Discussing with Stefano, a friend of mine and a great Java/J2ME programmer, I decided to focus on a simple, long-term project: a little chat with a GUI that uses HTTP to send and receive messages. We decided that we'd build the same application with both Java and Perl and write an article together; obviously, since I had to learn everything about GUIs and threads and I had not a lot of spare time, we imposed ourselves no deadline.

I started months ago with trying to make sense of threads, reading the whole Camel Book's chapter on the topic and the perlthrtut. Before digging into the real application I experimented a bit at first.

Then many non-perl things happened, and I did nothing more on the project.

A couple of nights ago I went back to it and, finally, I had a program that manages connections on a port with a thread and pings the localhost with another. Now that I start to understand how things work, it doesn't seem that hard to create a threaded program that listens on a port for HTTP connections and, when asked, fires up an HTTP connection to another HTTP server.

Considering that, all in all, it required me a short time to understand how to work it out and that I worked on the project from time to time I am quite happy of myself, and it is giving me the necessary boost to experiment with the chat GUI.

Obviously, if they'll leave me the time to experiment with that...