gri6507 has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I've been playing around with the idea of porting one my my games from Java into Perl. As you may know, a game under Java is normally done with two or more threads, one for drawing only, and the other for doing the busy work. This produces a noticible increase in the speed of the game (espacially, the redrawing portion reduces the amount of screen flicker).

I have written games in Tk before and I don't remember them being too slow (at least not noticibly so). Would there be any advantage to using multiple threads in Perl to achive greater speed and smoother refreshes?

Replies are listed 'Best First'.
Re (tilly) 1: Merits of Threads for a Tk Game
by tilly (Archbishop) on Mar 03, 2002 at 04:27 UTC
    I don't have a good answer for you.

    I can tell you that if your game requires substantial background processing, threading is likely to improve interactivity. I can tell you that Perl's threading models leave something to be desired. (Though by all accounts 5.6.x is better than 5.005.) Perl's threading is experimental and subject to change. And I would avoid Perl's threading for anything I considered important.

    Beyond that you may want to read Threads vs Forking (Java vs Perl) for a good overview of the difference between threading and multiple processes, and some of the risks of threading. Some of which you might not encounter in Java because the language channels you towards guaranteed safe behaviour. All of which might be basic background to you.