Unifix knowledge database - The original one

Dashboard - News - Search - List - About - Admin


Using threads in perl

Author:benne - Sun Jun 15 15:35:51 2003

Remember setting threads in your ./Configure, cause it's not compiled by default!

Example:

#!/usr/bin/perl

use Thread;

new Thread \&test_sub;

sub test_sub {
  while(1) {
    sleep 2;
    print "TestSUB\n";
  }
}

while(1){
  sleep 3;
  print "NormalProc\n";
}


For more information, see http://www.xav.com/perl/lib/Thread.html
Copyright(c) Unifix.org 2002-2011


Dashboard - News - Search - List - About - Admin
 
Powered by Mikjaer Consulting Solutions - Hosted by Specialhosting.dk