RE: ithreads

2005-03-31 Thread Alan Peck
Thanx you all your comments,

I see what I can put together that is effective.

Alun

Alun Peck
Section Head: Computers
Department of Mathematical Technology
Faculty of Natural Sciences
Tshwane University of Technology
[EMAIL PROTECTED]
Tel: (012) 318 6389
Fax: (012) 318 6114
>>> "Anderson, Mark (Service Delivery)" <[EMAIL PROTECTED]> 04/01/05 8:30 AM >>>
Remember that a response to ping doesn't actually mean the machine's
"alive", only that the NIC is responding.  I've seen servers and
workstations that have crashed respond to ping far too often.  I'd recommend
you $response=`NBTSTAT -a $computer` the machines instead then grep the
results for the machine name or "host not found"

Kind regards,

Mark Anderson
Service Improvement Programme
Level 2, 113 Dundas Street
Edinburgh, EH3 5DE
Tel: 0131 523 8786
Mob: 07808 826 063


> -Original Message-
> From: [EMAIL PROTECTED]
> [SMTP:[EMAIL PROTECTED] On Behalf Of Paul
> Sobey
> Sent: Thursday, March 31, 2005 4:50 PM
> To:   perl-win32-users@listserv.ActiveState.com
> Subject:  RE: ithreads
> 
> *** WARNING : This message originates from the Internet ***
> 
> Why not ping the list of machines, throw the ones that are up onto a
> Thread::Queue, and have your threads pop them off one at a time? That
> way you guarantee that your threads always get a machine that's up to
> target. The other reason they might get upset, access denied accessing
> the remote registry, will be thrown nice and quickly.
> 
> One aside - what module are you using to access the registry, and are
> you sure it's threadsafe? Win32::OLE certainly isn't...
> 
> Paul
>  
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> John Serink
> Sent: 31 March 2005 15:49
> To: Alan Peck; perl-win32-users@listserv.ActiveState.com
> Subject: RE: ithreads
> 
> If you're accessing the registry on remote PCs, you're using NetBios
> over TCP/IP, commonly referred to Microsoft Networking. I have no idea
> what NetBios default timeouts are. For TCP the connection timeout is 20
> seconds on a Windoze box, user setable on Linux. You may be able to set
> the SMB timeouts but I think it gets a bit complicated with the way SMB
> browsing works
> 
> If you could timeout the thread, that would be great; however, that is
> not yet supported.
> Cheers,
> John
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On 
> > Behalf Of Alan Peck
> > Sent: Thursday, March 31, 2005 1:04 PM
> > To: perl-win32-users@listserv.ActiveState.com
> > Subject: RE: ithreads
> > 
> > 
> > Thanx for you advise.
> > 
> > I am accessing the Registry of the remote PCs, and if 
> > something goes weird on the client PC the script ends up 
> > waiting for the timeout to occur. If there is a way to change 
> > the timeout for connecting to the remote PC Registry that 
> > would be simply wonderful. 10 secs is plenty enough time to 
> > realize something is wrong on a 1 Gbit network.
> > 
> > I managed to decrease the load a wee bit by running the 
> > script from 4 servers instead of 1 and dividing the PC load 
> > between the 4 servers according to LAN segments.
> > 
> > Alun
> > 
> > >>> "John Serink" <[EMAIL PROTECTED]> 03/30/05 5:24 PM >>>
> > Hiyah:
> > 
> > Ok, the thing you'll NOT want to do is spawn the threads all 
> > at once. I'd do them say, in groups of 25 or so which will 
> > allow the ones that finish, out of the 25, to complete and 
> > die thus freeing up memory for your other 2975. SO, in pseudo 
> > code, do this: spawn threads 0-24, do stuff, sleep for 0.01 
> > seconds (free up the CPU), Go back to the top until you're done.
> > 
> > Worst case is that the threads that can't find their server 
> > will timeout and die after 20 secondswhich is why on 
> > Win32 you need to sue threads for TCP apps, the timeouts for 
> > connecting to sockets don't work in perl. The basic trick is, 
> > don't spawn the lot in one go, dribble them out.
> > 
> > Cheers,
> > John
> > 
> > 
> > > -Original Message-
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On 
> > > Behalf Of Alan Peck
> > > Sent: Wednesday, March 30, 2005 5:12 PM
> > > To: perl-win32-users@listserv.ActiveState.com
> > > Subject: ithreads
> > > 
> > > 
> > > In order to resolve a networking problem in a timely manner I
> > > required to make use of threads (particular the ithreads 
> > > implimentation).
> > > 
> > > The only problem is that the memory usage rockets as each
> > > thread starts it's own perl interpreter. I need roughly 3000 
> > > connection threads to be able to obtain the required 
> > > information within 2 mins. If I use a single thread the time 
> > > can take between 0 mins to 3000 mins to complete, depending 
> > > on how many response timeouts one obtains. I have been able 
> > > to create 150 thread connections before running out of RAM. 
> > > Keeping within the RAM limit, I am able to retrieve the 
> > > information from

restraining grep

2005-03-31 Thread Spencer_Lists
Greetings perl-win32-users,

I have a few programs that accept user input as a series of integer
values pairs separated by a delimiters between the pairs and the
elements of the pairs. I previously made an array out of the first
halves of the pairs and also a hash indexed by the first value and
containing the second element of each pair as the value of the hash.
Later in the program I would use grep to determine if an integer was
contained in the first array mentioned. After using these programs for
some time, I suddenly discovered that grep on an array didn't seem to
match integers exactly. It was as if the comparisons were of strings
and substrings would match larger strings so grep would return true
for 10 in an array that had 110 in it. Not what I wanted so instead I
check to see if the value of the hash is defined. Still, I was
wondering if there is any way to use grep to exactly match an element
of an array.

--
Best regards,
Spencer_Lists Chasemailto:[EMAIL PROTECTED]

[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: ithreads

2005-03-31 Thread Anderson, Mark (Service Delivery)
Remember that a response to ping doesn't actually mean the machine's
"alive", only that the NIC is responding.  I've seen servers and
workstations that have crashed respond to ping far too often.  I'd recommend
you $response=`NBTSTAT -a $computer` the machines instead then grep the
results for the machine name or "host not found"

Kind regards,

Mark Anderson
Service Improvement Programme
Level 2, 113 Dundas Street
Edinburgh, EH3 5DE
Tel: 0131 523 8786
Mob: 07808 826 063


> -Original Message-
> From: [EMAIL PROTECTED]
> [SMTP:[EMAIL PROTECTED] On Behalf Of Paul
> Sobey
> Sent: Thursday, March 31, 2005 4:50 PM
> To:   perl-win32-users@listserv.ActiveState.com
> Subject:  RE: ithreads
> 
> *** WARNING : This message originates from the Internet ***
> 
> Why not ping the list of machines, throw the ones that are up onto a
> Thread::Queue, and have your threads pop them off one at a time? That
> way you guarantee that your threads always get a machine that's up to
> target. The other reason they might get upset, access denied accessing
> the remote registry, will be thrown nice and quickly.
> 
> One aside - what module are you using to access the registry, and are
> you sure it's threadsafe? Win32::OLE certainly isn't...
> 
> Paul
>  
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> John Serink
> Sent: 31 March 2005 15:49
> To: Alan Peck; perl-win32-users@listserv.ActiveState.com
> Subject: RE: ithreads
> 
> If you're accessing the registry on remote PCs, you're using NetBios
> over TCP/IP, commonly referred to Microsoft Networking. I have no idea
> what NetBios default timeouts are. For TCP the connection timeout is 20
> seconds on a Windoze box, user setable on Linux. You may be able to set
> the SMB timeouts but I think it gets a bit complicated with the way SMB
> browsing works
> 
> If you could timeout the thread, that would be great; however, that is
> not yet supported.
> Cheers,
> John
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On 
> > Behalf Of Alan Peck
> > Sent: Thursday, March 31, 2005 1:04 PM
> > To: perl-win32-users@listserv.ActiveState.com
> > Subject: RE: ithreads
> > 
> > 
> > Thanx for you advise.
> > 
> > I am accessing the Registry of the remote PCs, and if 
> > something goes weird on the client PC the script ends up 
> > waiting for the timeout to occur. If there is a way to change 
> > the timeout for connecting to the remote PC Registry that 
> > would be simply wonderful. 10 secs is plenty enough time to 
> > realize something is wrong on a 1 Gbit network.
> > 
> > I managed to decrease the load a wee bit by running the 
> > script from 4 servers instead of 1 and dividing the PC load 
> > between the 4 servers according to LAN segments.
> > 
> > Alun
> > 
> > >>> "John Serink" <[EMAIL PROTECTED]> 03/30/05 5:24 PM >>>
> > Hiyah:
> > 
> > Ok, the thing you'll NOT want to do is spawn the threads all 
> > at once. I'd do them say, in groups of 25 or so which will 
> > allow the ones that finish, out of the 25, to complete and 
> > die thus freeing up memory for your other 2975. SO, in pseudo 
> > code, do this: spawn threads 0-24, do stuff, sleep for 0.01 
> > seconds (free up the CPU), Go back to the top until you're done.
> > 
> > Worst case is that the threads that can't find their server 
> > will timeout and die after 20 secondswhich is why on 
> > Win32 you need to sue threads for TCP apps, the timeouts for 
> > connecting to sockets don't work in perl. The basic trick is, 
> > don't spawn the lot in one go, dribble them out.
> > 
> > Cheers,
> > John
> > 
> > 
> > > -Original Message-
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On 
> > > Behalf Of Alan Peck
> > > Sent: Wednesday, March 30, 2005 5:12 PM
> > > To: perl-win32-users@listserv.ActiveState.com
> > > Subject: ithreads
> > > 
> > > 
> > > In order to resolve a networking problem in a timely manner I
> > > required to make use of threads (particular the ithreads 
> > > implimentation).
> > > 
> > > The only problem is that the memory usage rockets as each
> > > thread starts it's own perl interpreter. I need roughly 3000 
> > > connection threads to be able to obtain the required 
> > > information within 2 mins. If I use a single thread the time 
> > > can take between 0 mins to 3000 mins to complete, depending 
> > > on how many response timeouts one obtains. I have been able 
> > > to create 150 thread connections before running out of RAM. 
> > > Keeping within the RAM limit, I am able to retrieve the 
> > > information from 150 PCs within 2 mins, making use of a real 
> > > bad situation setup where at least half will timeout delibrately.
> > > 
> > > Is there a way to instruct perl to only load one copy of the
> > > perl code into RAM and create separate data segments with 
> > > their own instruction pointers for each thread?
> > > 
> > > Thanx
> > > --

RE: Config::IniHash and Unicode INI file

2005-03-31 Thread Bullock, Howard A.

I apologize for the previous post that was sent prematurely.

After reading the IniHash.pm I found that I could pass The ReadINI method a
scalar reference.
So my solution is:

use Encode;
open(FH, "<:encoding(UTF-16)", $file);
my $Data;
{
local $/;
$Data = ;
close FH;
}
my $DomainConfig = ReadINI (\$Data, \%ReadINIoptions);



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Config::IniHash and Unicode INI file

2005-03-31 Thread Bullock, Howard A.

After reading the IniHash.pm I found that I could pass The ReadINI method a
scalar reference.
So my solution is:

use Encode;
open(FH, "<:encoding(UTF-16)", $file);
my $Data;
{
local $/;
$Data = ;
close FH;#if (utf8::decode($Data)) {
#print "Success\n";
#}
#else {
#print "Fail\n";
#}
}
my $DomainConfig = ReadINI (\$Data, \%ReadINIoptions);



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Bullock, Howard A.
Sent: Thursday, March 31, 2005 9:51 PM
To: Perl-Win32-Users@listserv.ActiveState.com
Subject: Config::IniHash and Unicode INI file

Could someone give me a pointer to the methodology or relevant docs for
using Config::IniHash with Perl 5.8.6 to read a Unicode INI file? The module
read the file but the data contains all the nulls.  Is there a way to
convert the Unicode to standard ASCII text upon reading?


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: [OT] Spam to list

2005-03-31 Thread $Bill Luebkert
Lloyd Sartor wrote:

> Ye of little faith...even PERL blesses those of the proper class...

Are you a pommy too ?  You're a lazy HTML top-poster - that much we're sure of. 
 ;)

> [EMAIL PROTECTED] wrote: -
> 
> To: Sisyphus <[EMAIL PROTECTED]>

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--<  o // //  Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: [OT] Spam to list

2005-03-31 Thread Lloyd Sartor
Ye of little faith...even PERL blesses those of the proper class...[EMAIL PROTECTED] wrote: -To: Sisyphus <[EMAIL PROTECTED]>From: "$Bill Luebkert" <[EMAIL PROTECTED]>Sent by: [EMAIL PROTECTED]Date: 03/31/2005 08:15PMcc: perl-win32-users Subject: Re: [OT] Spam to listSisyphus wrote:> Hi,> Whenever I reply to this list I receive a message from> [EMAIL PROTECTED] with the following subject:> > Symantec Mail Security detected that you sent a message containing> prohibited content that is considered spam - please call email recipient.> > The body of the email reads something like:> > Subject of the message: Re: More on Re: Windows DLL - Perl Interface> Recipient of the message: "Perl-Win32-Users@listserv.ActiveState.com"> > > Does anybody else receive these gems ? Anyone know what's (likely to be)> going on ? It's only mail to this list that generates the spam notification.> I don't know if I will receive it when I *start* a thread on this list > but I'm about to find out.Obviously they don't like Aussies.If that's not it, must be that M$ crap you're using to post with.If that's not it, I recommend bumping [EMAIL PROTECTED] from the Win32 list.If that doesn't help, quit posting to the list.If that doesn't get it, email your posts to me and I'll forward them to the list.If that doesn't work, pray - but I'm sure that won't help.PS: I don't get the rejections you speak of, but I do get tons of OOF replies.--   ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED] (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/-/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)___Perl-Win32-Users mailing listPerl-Win32-Users@listserv.ActiveState.comTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: [OT] Spam to list

2005-03-31 Thread Ted Schuerzinger
$Bill Luebkert graced perl with these words of wisdom:

> PS: I don't get the rejections you speak of, but I do get tons of OOF
> replies. 

Every time I get those I think about actually responding to the people 
mentioned in them as contacts.  Perhaps doing that might get people to 
configure list subscriptions better.  :-)

-- 
Ted 
TV Announcer: It's 11:00.  Do you know where your children are?
Homer: I told you last night, *no*!

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: [OT] Spam to list

2005-03-31 Thread Allegakoen, Justin Devanandan
8<- 
Yep - I still get that notification.

> 
> Obviously they don't like Aussies.

Hmmm ... I didn't think there were any Kiwis on this list.
8<-

Nope it only targets the $10 poms. $15 poms are left out because they
paid extra (justified by the extra distance the boats need to travel in
order to reach NZ from England).

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: [OT] Spam to list

2005-03-31 Thread sisyphus

- Original Message - 
From: "$Bill Luebkert" <[EMAIL PROTECTED]>
To: "Sisyphus" <[EMAIL PROTECTED]>
Cc: "perl-win32-users" 
Sent: Friday, April 01, 2005 12:15 PM
Subject: Re: [OT] Spam to list


> Sisyphus wrote:
> > Hi,
> > Whenever I reply to this list I receive a message from
> > [EMAIL PROTECTED] with the following subject:
> > 
> > Symantec Mail Security detected that you sent a message containing
> > prohibited content that is considered spam - please call email recipient.
> > 
> > The body of the email reads something like:
> > 
> > Subject of the message: Re: More on Re: Windows DLL - Perl Interface
> > Recipient of the message: "Perl-Win32-Users@listserv.ActiveState.com"
> > 
> > 
> > Does anybody else receive these gems ? Anyone know what's (likely to be)
> > going on ? It's only mail to this list that generates the spam notification.
> > I don't know if I will receive it when I *start* a thread on this list 
> > but I'm about to find out.

Yep - I still get that notification.

> 
> Obviously they don't like Aussies.

Hmmm ... I didn't think there were any Kiwis on this list.

> If that's not it, must be that M$ crap you're using to post with.

Quite possibly - this post is being sent using Net::SMTP. Hopefully it won't 
include the offending headers.

> If that's not it, I recommend bumping [EMAIL PROTECTED] from the Win32 list.

I'll second that.

> If that doesn't help, quit posting to the list.

Aaah  you're too kind. Some would say "Even if it *does* help, quit posting 
to the list anyway."

> If that doesn't get it, email your posts to me and I'll forward them to the 
> list.

Now *that* would be fun (for both of us :-)

> If that doesn't work, pray - but I'm sure that won't help.

Never helped before - but then I've never tried it before...

Cheers,
Rob


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Config::IniHash and Unicode INI file

2005-03-31 Thread Bullock, Howard A.
Title: Config::IniHash and Unicode INI file






Could someone give me a pointer to the methodology or relevant docs for using Config::IniHash with Perl 5.8.6 to read a Unicode INI file? The module read the file but the data contains all the nulls.  Is there a way to convert the Unicode to standard ASCII text upon reading?



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: [OT] Spam to list

2005-03-31 Thread Leigh Sharpe
> 
> Obviously they don't like Aussies.
> 


That's not it.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: [OT] Spam to list

2005-03-31 Thread $Bill Luebkert
Sisyphus wrote:
> Hi,
> Whenever I reply to this list I receive a message from
> [EMAIL PROTECTED] with the following subject:
> 
> Symantec Mail Security detected that you sent a message containing
> prohibited content that is considered spam - please call email recipient.
> 
> The body of the email reads something like:
> 
> Subject of the message: Re: More on Re: Windows DLL - Perl Interface
> Recipient of the message: "Perl-Win32-Users@listserv.ActiveState.com"
> 
> 
> Does anybody else receive these gems ? Anyone know what's (likely to be)
> going on ? It's only mail to this list that generates the spam notification.
> I don't know if I will receive it when I *start* a thread on this list 
> but I'm about to find out.

Obviously they don't like Aussies.
If that's not it, must be that M$ crap you're using to post with.
If that's not it, I recommend bumping [EMAIL PROTECTED] from the Win32 list.
If that doesn't help, quit posting to the list.
If that doesn't get it, email your posts to me and I'll forward them to the 
list.
If that doesn't work, pray - but I'm sure that won't help.

PS: I don't get the rejections you speak of, but I do get tons of OOF replies.

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--<  o // //  Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: [OT] Spam to list

2005-03-31 Thread Gregory S. Williamson
Not I ...
G

-Original Message-
From:   Sisyphus [mailto:[EMAIL PROTECTED]
Sent:   Thu 3/31/2005 5:50 PM
To: perl-win32-users
Cc: 
Subject:[OT] Spam to list
Hi,
Whenever I reply to this list I receive a message from
[EMAIL PROTECTED] with the following subject:

Symantec Mail Security detected that you sent a message containing
prohibited content that is considered spam - please call email recipient.

The body of the email reads something like:

Subject of the message: Re: More on Re: Windows DLL - Perl Interface
Recipient of the message: "Perl-Win32-Users@listserv.ActiveState.com"


Does anybody else receive these gems ? Anyone know what's (likely to be)
going on ? It's only mail to this list that generates the spam notification.
I don't know if I will receive it when I *start* a thread on this list 
but I'm about to find out.

Cheers,
Rob


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

!DSPAM:424caa47197031367817404!



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


[OT] Spam to list

2005-03-31 Thread Sisyphus
Hi,
Whenever I reply to this list I receive a message from
[EMAIL PROTECTED] with the following subject:

Symantec Mail Security detected that you sent a message containing
prohibited content that is considered spam - please call email recipient.

The body of the email reads something like:

Subject of the message: Re: More on Re: Windows DLL - Perl Interface
Recipient of the message: "Perl-Win32-Users@listserv.ActiveState.com"


Does anybody else receive these gems ? Anyone know what's (likely to be)
going on ? It's only mail to this list that generates the spam notification.
I don't know if I will receive it when I *start* a thread on this list 
but I'm about to find out.

Cheers,
Rob


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: More on Re: Windows DLL - Perl Interface

2005-03-31 Thread Sisyphus


- Original Message - 
From: "Johan Lindström" <[EMAIL PROTECTED]>
To: 
Sent: Friday, April 01, 2005 8:24 AM
Subject: RE: More on Re: Windows DLL - Perl Interface


> At 23:41 2005-03-31, Lloyd Sartor wrote:
> >But if I needed a solution in a timely manner, I would concisely define
> >what must be OO, and then probably attack it with Inline::C or
Inline:C++.
> >Win32::API certainly has its limitations.
>
> That's a good idea, except Inline::CPP doesn't work very well on Windows
> with VC++ 6.
>
> Actually, the tests don't pass, but I think it's templates stuff, the
basic
> things aren't broken.
>
> Look at the bugs in RT to see a few hints on how to fix some problems
yourself.
>  http://rt.cpan.org/NoAuth/Bugs.html?Dist=Inline-CPP
>

Microsoft have fixed both the 'templates' problem and the 16varlst.t problem
with VC 7, though if you want to use VC 7 with perl you should first build
perl with VC 7. I can't find a solution to the problem with 16varlst.t for
VC 6. I guess if you can avoid that particular construct that VC 6 doesn't
like, then it's not a problem.

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


How to find process owner?

2005-03-31 Thread Lyle Kopnicky
I am now using the code below to print a list of processes on the 
computer.  It works.  However, I would like to be able to tell which 
user is running each process.  I need to be able to find a process with 
a certain name, running under a certain user account.  How can I do this?

Thanks,
Lyle Kopnicky
##
use Win32::PerfLib;
%proc_list = get_remote_process_list('');
foreach $i (keys %proc_list) {
   print "$i: $proc_list{$i}\n";
}
sub get_remote_process_list {
my $server = $_[0];
my %rtasks;
my %counter;
Win32::PerfLib::GetCounterNames($server, \%counter);
my %r_counter = map { $counter{$_} => $_ } keys %counter;
# retrieve the id for process object
my $process_obj = $r_counter{Process};
# retrieve the id for the process ID counter
my $process_id = $r_counter{'ID Process'};
# create connection to $server
my $perflib = new Win32::PerfLib($server);
my $proc_ref = {};
# get the performance data for the process object
$perflib->GetObjectList($process_obj, $proc_ref);
$perflib->Close();
my $instance_ref = $proc_ref->{Objects}->{$process_obj}->{Instances};
foreach my $p (sort keys %{$instance_ref})
{
   my $counter_ref = $instance_ref->{$p}->{Counters};
   foreach my $i (keys %{$counter_ref})
   {
   if($counter_ref->{$i}->{CounterNameTitleIndex} == $process_id)
   {
   $rtasks{$counter_ref->{$i}->{Counter}} =
   $instance_ref->{$p}->{Name};
   }
   }
}
 return %rtasks;
}
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Nothing from Win32::PerfLib::GetCounterNames()

2005-03-31 Thread Lyle Kopnicky
Rhesa Rozendaal wrote:
Lyle Kopnicky wrote:
I tried the following code:
 use Win32::PerfLib;
 my %counter;
 Win32::PerfLib::GetCounterNames('localhost', \%counter);

Try an empty string for the local machine:
Win32::PerfLib::GetCounterNames('', \%counter);
That worked.
Thanks,
Lyle Kopnicky
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Nothing from Win32::PerfLib::GetCounterNames()

2005-03-31 Thread Rhesa Rozendaal
Lyle Kopnicky wrote:
I tried the following code:
 use Win32::PerfLib;
 my %counter;
 Win32::PerfLib::GetCounterNames('localhost', \%counter);
Try an empty string for the local machine:
Win32::PerfLib::GetCounterNames('', \%counter);
 print "Number of counter hash keys: " . (scalar (keys counter)) . "\n";
This is the start of a program designed to get a list of processes.  Any 
idea why I am not getting the hash of counter names?
Your machines are likely called something different than localhost.
HTH,
Rhesa
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Nothing from Win32::PerfLib::GetCounterNames()

2005-03-31 Thread Lyle Kopnicky
I tried the following code:
 use Win32::PerfLib;
 my %counter;
 Win32::PerfLib::GetCounterNames('localhost', \%counter);
 print "Number of counter hash keys: " . (scalar (keys counter)) . "\n";
... and I get 0.  I am running it on Windows XP Home with ActiveState 
Perl 5.8.6.  I also tried it on Windows NT 4.0 TSE with ActiveState Perl 
5.8.3.  Same answer.

This is the start of a program designed to get a list of processes.  Any 
idea why I am not getting the hash of counter names?

Thanks,
Lyle Kopnicky
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Using Net-telnet to connect via ssh

2005-03-31 Thread Sisyphus


- Original Message - 
From: "GT BAUTISTA, Rodel D." <[EMAIL PROTECTED]>
To: 
Sent: Thursday, March 31, 2005 5:05 PM
Subject: Using Net-telnet to connect via ssh


Hi to All,

Is there a windows binary distribution of IO-Tty (or IO-Pty)? I can't
install the one I downloaded from cpan. I'm having errors in the
compiler 'cl' but it is already installed and PATH is properly defined.
Below are the errors from the log during makefile.pl:

compilerok.c
c1 : warning C4349: /Gf is deprecated and will not be supported in
future versions of Visual C++; remove /Gf or use /GF instead
LINK : fatal error LNK1104: cannot open file 'MSVCRT.lib'

Also, where can I download a copy of MSVCRt.lib.

thanks and best regards.

Rodel Bautista


Afaik IO-Tty won't build on Win32 - but the errors you got are not what I
expected.
MSVCRT.lib should be in the 'lib' folder of your Visual Studio compiler. Did
you run vcvars32.bat to set up the appropriate environment variables before
you tried to build the module ?

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: More on Re: Windows DLL - Perl Interface

2005-03-31 Thread Johan Lindstr
At 23:41 2005-03-31, Lloyd Sartor wrote:
But if I needed a solution in a timely manner, I would concisely define 
what must be OO, and then probably attack it with Inline::C or Inline:C++. 
Win32::API certainly has its limitations.
That's a good idea, except Inline::CPP doesn't work very well on Windows 
with VC++ 6.

Actually, the tests don't pass, but I think it's templates stuff, the basic 
things aren't broken.

Look at the bugs in RT to see a few hints on how to fix some problems yourself.
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Inline-CPP
/J
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: More on Re: Windows DLL - Perl Interface

2005-03-31 Thread Sisyphus


- Original Message - 
From: "Lloyd Sartor" <[EMAIL PROTECTED]>
To: "Bharucha, Nikhil" <[EMAIL PROTECTED]>
Cc: "Sisyphus" <[EMAIL PROTECTED]>;
;
<[EMAIL PROTECTED]>
Sent: Friday, April 01, 2005 7:41 AM
Subject: RE: More on Re: Windows DLL - Perl Interface


> It's not clear to me what is meant by "an OO manner." Is the DLL an
> implementation of one or more C++ classes? Or is the DLL being accessed
> from within a Perl class/object? Or both?
>
> Your questions lead me to consider passing objects between C++ and Perl. I
> don't know how that would/could be done. But it might be an interesting
> science project.
>

I think Inline::CPP handles this fairly seamlessly but, as I don't properly
understand C++ (and hardly ever use it), I'm not too sure.
The second example in 'perldoc Inline::CPP' looks helpful, and other
examples are provided by the test files in the grammar/t/ folder in the
Inline-CPP-0.25 source tarball.
As regards Inline::C and OO, there's an example in 'perldoc
Inline::C-Cookbook' which might be of some assistance. (Search for 'Object
Oriented Inline'.)

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: More on Re: Windows DLL - Perl Interface

2005-03-31 Thread Lloyd Sartor

It's not clear to me what is meant by
"an OO manner." Is the DLL an implementation of one or more C++
classes? Or is the DLL being accessed from within a Perl class/object?
Or both?

Your questions lead me to consider passing
objects between C++ and Perl. I don't know how that would/could be done.
But it might be an interesting science project.

But if I needed a solution in a timely
manner, I would concisely define what must be OO, and then probably attack
it with Inline::C or Inline:C++. Win32::API certainly has its limitations.

I will be interested in hearing how
you proceed.

Good luck,
Lloyd

[EMAIL PROTECTED]
wrote on 03/31/2005 03:21:42 PM:

> Any updates on this?
> 
> I have no choice but to access a DLL in an OO manner.  Win32::API
in its
> latest release seems to be geared towards non-oo implementation
> (importing it in to behave like a sub) with little doc on how to handle
> it in an OO manner.  Additionally, all of the packing and unpacking...
> 
> Isn't there something easier to use out there?  
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
Of
> Sisyphus
> Sent: Tuesday, March 15, 2005 4:03 PM
> Cc: Perl-Win32-Users@listserv.ActiveState.com
> Subject: Re: More on Re: Windows DLL - Perl Interface
> 
> Lloyd Sartor wrote:
> > FYI - if I had to do it all over again, I would go the Inline::C
> route, 
> > although it may take some time to get the compiler tools installed.
> > 
> 
> That's my preferred route, too - and installing the "compiler
tools" 
> amounts to nothing more than installing the MinGW binaries (and also

> installing ExtUtils::FakeConfig if you're running ActiveState perl.
> 
> Cheers,
> Rob
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: More on Re: Windows DLL - Perl Interface

2005-03-31 Thread Bharucha, Nikhil
Any updates on this?

I have no choice but to access a DLL in an OO manner.  Win32::API in its
latest release seems to be geared towards non-oo implementation
(importing it in to behave like a sub) with little doc on how to handle
it in an OO manner.  Additionally, all of the packing and unpacking...

Isn't there something easier to use out there?  

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Sisyphus
Sent: Tuesday, March 15, 2005 4:03 PM
Cc: Perl-Win32-Users@listserv.ActiveState.com
Subject: Re: More on Re: Windows DLL - Perl Interface

Lloyd Sartor wrote:
> FYI - if I had to do it all over again, I would go the Inline::C
route, 
> although it may take some time to get the compiler tools installed.
> 

That's my preferred route, too - and installing the "compiler tools" 
amounts to nothing more than installing the MinGW binaries (and also 
installing ExtUtils::FakeConfig if you're running ActiveState perl.

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: ithreads

2005-03-31 Thread Peter Guzis
You can always stay single-threaded and use POE::Component::Client::Ping.  If 
you aren't familiar with POE, though, it may present a bit of a learning curve.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Dietmar Fiehn, Dr.
Sent: Wednesday, March 30, 2005 2:03 AM
To: perl-win32-users@listserv.ActiveState.com
Subject: AW: ithreads


In order to resolve a networking problem in a timely manner I required 
to make use of threads (particular the ithreads implimentation).

The only problem is that the memory usage rockets as each thread starts 
it's own perl interpreter. I need roughly 3000 connection threads to be able to 
obtain the required information within 2 mins. If I use a single thread the 
time can take between 0 mins to 3000 mins to complete, depending on how many 
response timeouts one obtains. I have been able to create 150 thread 
connections before running out of RAM. Keeping within the RAM limit, I am able 
to retrieve the information from 150 PCs within 2 mins, making use of a real 
bad situation setup where at least half will timeout delibrately.

Is there a way to instruct perl to only load one copy of the perl code 
into RAM and create separate data segments with their own instruction pointers 
for each thread?

Thanx

Please give us some more information about the type of information you are 
requesting and the protocoll used. Maybe you can do some parallel requests 
without threads.

Dietmar


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: ithreads

2005-03-31 Thread Paul Sobey
Why not ping the list of machines, throw the ones that are up onto a
Thread::Queue, and have your threads pop them off one at a time? That
way you guarantee that your threads always get a machine that's up to
target. The other reason they might get upset, access denied accessing
the remote registry, will be thrown nice and quickly.

One aside - what module are you using to access the registry, and are
you sure it's threadsafe? Win32::OLE certainly isn't...

Paul
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
John Serink
Sent: 31 March 2005 15:49
To: Alan Peck; perl-win32-users@listserv.ActiveState.com
Subject: RE: ithreads

If you're accessing the registry on remote PCs, you're using NetBios
over TCP/IP, commonly referred to Microsoft Networking. I have no idea
what NetBios default timeouts are. For TCP the connection timeout is 20
seconds on a Windoze box, user setable on Linux. You may be able to set
the SMB timeouts but I think it gets a bit complicated with the way SMB
browsing works

If you could timeout the thread, that would be great; however, that is
not yet supported.
Cheers,
John

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Alan Peck
> Sent: Thursday, March 31, 2005 1:04 PM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: RE: ithreads
> 
> 
> Thanx for you advise.
> 
> I am accessing the Registry of the remote PCs, and if 
> something goes weird on the client PC the script ends up 
> waiting for the timeout to occur. If there is a way to change 
> the timeout for connecting to the remote PC Registry that 
> would be simply wonderful. 10 secs is plenty enough time to 
> realize something is wrong on a 1 Gbit network.
> 
> I managed to decrease the load a wee bit by running the 
> script from 4 servers instead of 1 and dividing the PC load 
> between the 4 servers according to LAN segments.
> 
> Alun
> 
> >>> "John Serink" <[EMAIL PROTECTED]> 03/30/05 5:24 PM >>>
> Hiyah:
> 
> Ok, the thing you'll NOT want to do is spawn the threads all 
> at once. I'd do them say, in groups of 25 or so which will 
> allow the ones that finish, out of the 25, to complete and 
> die thus freeing up memory for your other 2975. SO, in pseudo 
> code, do this: spawn threads 0-24, do stuff, sleep for 0.01 
> seconds (free up the CPU), Go back to the top until you're done.
> 
> Worst case is that the threads that can't find their server 
> will timeout and die after 20 secondswhich is why on 
> Win32 you need to sue threads for TCP apps, the timeouts for 
> connecting to sockets don't work in perl. The basic trick is, 
> don't spawn the lot in one go, dribble them out.
> 
> Cheers,
> John
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On 
> > Behalf Of Alan Peck
> > Sent: Wednesday, March 30, 2005 5:12 PM
> > To: perl-win32-users@listserv.ActiveState.com
> > Subject: ithreads
> > 
> > 
> > In order to resolve a networking problem in a timely manner I
> > required to make use of threads (particular the ithreads 
> > implimentation).
> > 
> > The only problem is that the memory usage rockets as each
> > thread starts it's own perl interpreter. I need roughly 3000 
> > connection threads to be able to obtain the required 
> > information within 2 mins. If I use a single thread the time 
> > can take between 0 mins to 3000 mins to complete, depending 
> > on how many response timeouts one obtains. I have been able 
> > to create 150 thread connections before running out of RAM. 
> > Keeping within the RAM limit, I am able to retrieve the 
> > information from 150 PCs within 2 mins, making use of a real 
> > bad situation setup where at least half will timeout delibrately.
> > 
> > Is there a way to instruct perl to only load one copy of the
> > perl code into RAM and create separate data segments with 
> > their own instruction pointers for each thread?
> > 
> > Thanx
> > --
> > Tshwane University of Technology
> > --
> > This email is sent and received in terms of the
> > Electronic Communications Policy of Tshwane University of 
> > Technology. In line with this policy, this email is private, 
> > priviledged and confidential. The full text of the Electronic 
> > Mail Disclaimer can be seen on the TUT web site at 
> > http://www.tut.ac.za/goto/emaildisclaimer
> > or obtained by phoning (012) 318-5911
> > <<<>>>
> > 
> > ___
> > Perl-Win32-Users mailing list
> > Perl-Win32-Users@listserv.ActiveState.com
> > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> > 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
> 
> __

RE: Archive::Zip - Bad file descriptor on directories

2005-03-31 Thread Gardner, Sam
I noted I had some problems using the constants (e.g., AZ_OK) with
Archive::Zip, so I went with the literal values.

Sam Gardner

GTO Application Development

Keefe, Bruyette & Woods, Inc.

212-887-6753





-Original Message-
From: Sisyphus [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 30, 2005 11:59 PM
To: Ben Conrad; perl-win32-users@listserv.ActiveState.com
Subject: Re: Archive::Zip - Bad file descriptor on directories




- Original Message - 
From: "Ben Conrad" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, March 31, 2005 7:37 AM
Subject: Archive::Zip - Bad file descriptor on directories


> Folks,
>
> I'm not sure what the problem is but I can't seem to get a valid 
> return
when
> using  $zip->writeToFileNamed().  It works when I zip a single file, 
> but when I use
> addTree() I get "Bad file descriptor".  Am I doing something wrong?
>
>

use warnings;
use strict;

> use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
> # FYI, I'm using Version : 1.22 of Zlib.pm per the FAQ
>
> my $zip = Archive::Zip->new();
> my $dir = 'c:/temp';
>
> unlink ("$dir/xxx.zip") if ( -f "$dir/xxx.zip") ;
>
> #
> # This works
> #
> # $member = $zip->addFile( 'y1.txt' );
> # $zip->writeToFileNamed( 'someZip.zip' ) || die "ERROR $!" if $status 
> !=
AZ_OK;

What is $status ? Even if 'writeToFileNamed()' fails, I doubt that the
script will die, or that you'll see any error message. Rewrite as something
like (untested):

my $status = $zip->writeToFileNamed( 'someZip.zip' );
die "ERROR $!" if $status != AZ_OK;

>
> if ( -d "$dir/mydir" ) {
> my $result = $zip->addTree( "$dir/mydir", 'mydir1' );
> # I monitor this with filemon.exe and I do see it go through all the 
> dirs and files. print "result is: $result\n";
>
> # $result = $zip->writeToFileNamed("$dir/xxx.zip") || die "ERROR $!"; 
> ## This gives me: ERROR Bad file descriptor at archive.pl line 17 # 
> xxx.zip file exists and looks ok.

That's the wrong way to check for the error. If everything is ok, $result
will be 0 (remember that AZ_OK == 0), and the script will die. Rewrite as
something like (untested):

$result = $zip->writeToFileNamed("$dir/xxx.zip");
die "ERROR $!" if $result != AZ_OK;


>
> # $result = $zip->writeToFileNamed("$dir/xxx.zip") || die "ERROR $!" 
> if
$status != AZ_OK;
> # this does not die but also does not create a .zip
>

I don't know what $status is - and I'm not sure how that line of code will
be evaluated. I would think that, if 'writeToFileNamed()' fails, then
$result will be true, and the 'die()' will not even get looked at. Once
again, I recommend rewriting it as:

$result = $zip->writeToFileNamed("$dir/xxx.zip");
die "ERROR $!" if $result != AZ_OK;


> }
>
>

Cheers,
Rob

___
Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: ithreads

2005-03-31 Thread John Serink
If you're accessing the registry on remote PCs, you're using NetBios
over TCP/IP, commonly referred to Microsoft Networking. I have no idea
what NetBios default timeouts are. For TCP the connection timeout is 20
seconds on a Windoze box, user setable on Linux. You may be able to set
the SMB timeouts but I think it gets a bit complicated with the way SMB
browsing works

If you could timeout the thread, that would be great; however, that is
not yet supported.
Cheers,
John

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Alan Peck
> Sent: Thursday, March 31, 2005 1:04 PM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: RE: ithreads
> 
> 
> Thanx for you advise.
> 
> I am accessing the Registry of the remote PCs, and if 
> something goes weird on the client PC the script ends up 
> waiting for the timeout to occur. If there is a way to change 
> the timeout for connecting to the remote PC Registry that 
> would be simply wonderful. 10 secs is plenty enough time to 
> realize something is wrong on a 1 Gbit network.
> 
> I managed to decrease the load a wee bit by running the 
> script from 4 servers instead of 1 and dividing the PC load 
> between the 4 servers according to LAN segments.
> 
> Alun
> 
> >>> "John Serink" <[EMAIL PROTECTED]> 03/30/05 5:24 PM >>>
> Hiyah:
> 
> Ok, the thing you'll NOT want to do is spawn the threads all 
> at once. I'd do them say, in groups of 25 or so which will 
> allow the ones that finish, out of the 25, to complete and 
> die thus freeing up memory for your other 2975. SO, in pseudo 
> code, do this: spawn threads 0-24, do stuff, sleep for 0.01 
> seconds (free up the CPU), Go back to the top until you're done.
> 
> Worst case is that the threads that can't find their server 
> will timeout and die after 20 secondswhich is why on 
> Win32 you need to sue threads for TCP apps, the timeouts for 
> connecting to sockets don't work in perl. The basic trick is, 
> don't spawn the lot in one go, dribble them out.
> 
> Cheers,
> John
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On 
> > Behalf Of Alan Peck
> > Sent: Wednesday, March 30, 2005 5:12 PM
> > To: perl-win32-users@listserv.ActiveState.com
> > Subject: ithreads
> > 
> > 
> > In order to resolve a networking problem in a timely manner I
> > required to make use of threads (particular the ithreads 
> > implimentation).
> > 
> > The only problem is that the memory usage rockets as each
> > thread starts it's own perl interpreter. I need roughly 3000 
> > connection threads to be able to obtain the required 
> > information within 2 mins. If I use a single thread the time 
> > can take between 0 mins to 3000 mins to complete, depending 
> > on how many response timeouts one obtains. I have been able 
> > to create 150 thread connections before running out of RAM. 
> > Keeping within the RAM limit, I am able to retrieve the 
> > information from 150 PCs within 2 mins, making use of a real 
> > bad situation setup where at least half will timeout delibrately.
> > 
> > Is there a way to instruct perl to only load one copy of the
> > perl code into RAM and create separate data segments with 
> > their own instruction pointers for each thread?
> > 
> > Thanx
> > --
> > Tshwane University of Technology
> > --
> > This email is sent and received in terms of the
> > Electronic Communications Policy of Tshwane University of 
> > Technology. In line with this policy, this email is private, 
> > priviledged and confidential. The full text of the Electronic 
> > Mail Disclaimer can be seen on the TUT web site at 
> > http://www.tut.ac.za/goto/emaildisclaimer
> > or obtained by phoning (012) 318-5911
> > <<<>>>
> > 
> > ___
> > Perl-Win32-Users mailing list
> > Perl-Win32-Users@listserv.ActiveState.com
> > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> > 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Socket + fork

2005-03-31 Thread John Serink
I don't think signals are suported on Win32 boxes.
Cheers,
John

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of David Liouville
> Sent: Thursday, March 31, 2005 12:00 AM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: Socket + fork
> 
> 
> Could anybody tell me wy my server is closed at the #65 query 
> from client ? (I fork the server socket for futur use of many 
> clients) The parent process of the server seems to be closed 
> at the #65 execution of the ping query, but I don't 
> understand wy ... Thanks for help.
> 
> ### Server ###
> 
> use IO::Socket;
> 
> $server = IO::Socket::INET->new(
>   Proto => 'tcp',
>   LocalPort => "9000",
>   Listen=> 10,
>   Reuse => 1
> ) or die "can't setup server";
> 
> while ($client = $server->accept())
> {
>   $SIG{CHLD} = 'IGNORE';
>   my $child = fork;
>   do { close $client; next; } if $child;
>   $client->autoflush(1);
> 
>   while (<$client>)
>   {
>   $IntMatchCmd = 0;
>   chomp();
> 
>   if (m/ping/)
>   {
>   $IntMatchCmd = 1;
>   $client->send("pong\n",'');
>   }
>   else
>   {
>   print "unknown cmd";
>   }
> 
>   close $client;
>   print "close pid : '$child'\n";
>   exit;
>   }
> }
> 
> 
> ## Client ##
> use IO::Socket;
> 
> $IntCpt = 1;
> 
> while (1)
> {
>   print "#$IntCpt\n";
>   if ($TO_SERVER = IO::Socket::INET->new(
>   Proto => "tcp",
>   PeerAddr => "127.0.0.1",
>   PeerPort => "9000",
>   Type  => SOCK_STREAM,
>   Reuse => 1
>   ))
>   {
>   $IntCpt++;
>   $TO_SERVER->send("ping\n",'');
> 
>   while (<$TO_SERVER>)
>   {
>   chomp();
>   $StrResponse = $_;
>   print "Response : '$StrResponse'\n";
>   }
>   }
>   else
>   {
>   print "Error\n";
>   }
> } 
> 
> 
> 
>   OlixDavid Liouville
> ADR  : 1bis rue St Louis 35000 Rennes
> GSM : 06 88 70 16 45
> TEL   : 02 99 79 04 78
> FAX  : 02 99 79 78 17
> WEB : http://www.olix.fr 
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.8.4 - Release Date: 27/03/2005
>  
> 
> 
> ___
> Perl-Win32-Users mailing list 
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Socket + fork

2005-03-31 Thread Chris Wagner
I ran ur code and it went to 158 before I killed it.  I don't know why it
would die at 65 on ur system.  I'm on 98SE and perl build 811.

At 06:00 PM 3/30/05 +0200, David Liouville wrote:
>Could anybody tell me wy my server is closed at the #65 query from client ?
>(I fork the server socket for futur use of many clients) The parent process
>of the server seems to be closed at the #65 execution of the ping query, but






--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede males"

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Windows forking sockets

2005-03-31 Thread David Liouville
Have anybody a sample of client/server script wich fork and work under
windows with more than 64 executions time of client request ?

OlixDavid Liouville
ADR  : 1bis rue St Louis 35000 Rennes
GSM : 06 88 70 16 45
TEL   : 02 99 79 04 78
FAX  : 02 99 79 78 17
WEB : http://www.olix.fr 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.4 - Release Date: 27/03/2005
 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs