codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Thread question!  Nanchu at 19:21 on Monday, July 03, 2006
 

Hello i am writing a perl program. I would like to use threads in my application. I would like to open diectories and displays its files. Is this thread safe?

sub getDirSize {

opendir(DIRECTORY,$path) or die "error";

.....

closedir(DIRECTORY);
}

supose i will invoke this sub like this:

$T1 = new Thread \&getDirSize;
$T2 = new Thread \&getDirSize;

...

$T1->join;
$T2->join;

is this thread safe?


Thanks in advance,
Hernan Danielan.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: crystal report in windows C#.NET
•  Re: dynamic crystal report generation
•  is null or not an object error
•  Need to control remote machine
•  Re: convert minutes into hours and minutes
•  User input. Command line application.
•  Need help in building a daemon in Perl
•  Help us with a new game coming out?
•  Thread question!


Recent Articles
What is a pointer in C?
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net


© Copyright codetoad.com 2001-2006