Solved

multithread

Posted on 2000-03-02
4
263 Views
Last Modified: 2013-12-25
How Is it possible to make the cgi environment multithreaded? What kind of changes we need to make.  
0
Comment
Question by:seethiru
  • 2
  • 2
4 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 2576864
using win32 of unix ????

theres a win32 thread module, in active state this is still beta.  
0
 

Author Comment

by:seethiru
ID: 2577437
The question is focussed on unix.
0
 

Author Comment

by:seethiru
ID: 2577439
Adjusted points to 10
0
 
LVL 10

Accepted Solution

by:
makerp earned 10 total points
ID: 2579422
right then

two options for creating new proccess.

threads
OR
forking

forking is a bit of a more aggresive answer and takes the follwoing form

if( $pid = fork )
{
     # parent code here
     # proccess id avalibe in $pid
}
elsif
{
     # child here
     # parent processid avalible with
     # getppid()
}
else
{
     die "can fork() :".$!;
}

Threads

these are a more light wait answer but still only beta, well atleast in perl 5.005 and the perl build you have must be built for multi threading. see http://www.perl.com

# you can pass parameters to the function\sub as a second argument to the thread function.

$t = new Thread(mysub);

sub mysub()
{
     print("Heelo from mr thread");
}

this will create a new thread and the threads starting point will be mysub

there are quite a few thread functions for control etc see www.perl.com, you can get the module desciprtion etc....

hope this helps
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery Generalization 3 64
Studying Angular for employability 5 80
Wallpaper not updating when file is swapped out 6 52
Configure Robocopy to excluding folders 6 46
In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now