Re: Perl threads crash perl
Wl the problem is with the after thread exit clean up code inside the interpreter. If you do not call the $thread->join to clean up and make the number of your threads static and not dynamically created you are fine. Otherwise after a few news and joins things get hairy and the interpeter crashes I wrote a multithreaded telnet to odbc server using this approach !! As for the number of threads that are actually good , it seems to be a wide ranging magic munber between 2 and 15 dependant on the machine :-( I just wish fork would work with signals , none of the above would be necessary On Fri, 30 Jul 2004, John Deighan wrote: > Date: Fri, 30 Jul 2004 09:09:05 -0400 > From: John Deighan <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Re: Perl threads crash perl > > Seeing as noone else has responded to this, let me simply say that I tried > to develop an application using Perl threads, and in my opinion, Perl > threads are seriously broken. We had to re-write the application without > threads. > > The main problem was that threads would die, but I found no reliable way of > detecting this. Also, some advice I found on the web said that you > shouldn't create too many threads - they weren't designed for that. > However, there was no mention of what the limit might be, how to determine > the limit, or how to discover whether thread creation succeeded or failed. > All this means that if you want to create a couple of threads, it should > (?) work, but beyond that, who knows? > -- Angelos Karageorgiou Masters of Computer Science City University of New York http://www.unix.gr ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl threads crash perl
There is a compiled in limit of 100 threads in Win32 - I ran into this a few weeks back. Please see this thread. http://www.perlmonks.org/index.pl?node_id=373409 --mikej > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of John Deighan > Sent: Friday, July 30, 2004 9:09 AM > To: [EMAIL PROTECTED] > Subject: Re: Perl threads crash perl > > > Seeing as noone else has responded to this, let me simply say > that I tried > to develop an application using Perl threads, and in my opinion, Perl > threads are seriously broken. We had to re-write the > application without > threads. > > The main problem was that threads would die, but I found no > reliable way of > detecting this. Also, some advice I found on the web said that you > shouldn't create too many threads - they weren't designed for that. > However, there was no mention of what the limit might be, how > to determine > the limit, or how to discover whether thread creation > succeeded or failed. > All this means that if you want to create a couple of > threads, it should > (?) work, but beyond that, who knows? > > At 04:07 PM 7/29/2004, Nadjaf Kuliev wrote: > >When i tested my IIS vulnerability checker, it works > perfecly, but when I > >added multitasking support, it starts good, bit by bit cpu > noise increases > >then perl crases with unknown error. I didnt use fork(). I > used builtin > >Threads support with async{}. I dont want to make the code > public before > >first release so ill tell some details, if it wont help i > will email some of > >you who really wants to help the code. So here it is, the > main scripts gets > >all the vulnerability check, ie vulnerable file checks from > a file and tries > >them one by one on particular IIS webserver. Ony by one is > really slow, so I > >implemented threads. As you may know if it is checking the > webserver it > >surely will send HTTP requests for each vulnerable file. I > use IO::Socket > >only, not HTTP support modules. > > > >As far as i can guess, the reason for crash is most probably > not in the code > > but in the perl, perl threads support particularly and how > interacts with > >my OS - windows 98. > > > >Any help is greatly appreciated. Thanks in advance. > > > >Respect, OkIDaN. > >___ > >Perl-Win32-Users mailing list > >[EMAIL PROTECTED] > >To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl threads crash perl
El Viernes 30 Julio 2004 15:09, John Deighan escribió: > Seeing as noone else has responded to this, let me simply say that I tried > to develop an application using Perl threads, and in my opinion, Perl > threads are seriously broken. We had to re-write the application without > threads. > > The main problem was that threads would die, but I found no reliable way of > detecting this. Also, some advice I found on the web said that you > shouldn't create too many threads - they weren't designed for that. > However, there was no mention of what the limit might be, how to determine > the limit, or how to discover whether thread creation succeeded or failed. > All this means that if you want to create a couple of threads, it should > (?) work, but beyond that, who knows? --> Use threads::shared You can define a "control variable" and evaluate, for example i have 2 threads and one shared "control variable" called "$control" if my thread number one finish, first set these variable to $control="oneDied" and the second thread knows it because it do something like: if ($control = oneDied) {print "the first thread is dead ...\n"} I found that "control variables" are very good choice to send "signals" when you are using threads. For example i use it for know when all the threads are close and the main thread can do a clean exit. PD: Sorry for my English > > At 04:07 PM 7/29/2004, Nadjaf Kuliev wrote: > >When i tested my IIS vulnerability checker, it works perfecly, but when I > >added multitasking support, it starts good, bit by bit cpu noise increases > >then perl crases with unknown error. I didnt use fork(). I used builtin > >Threads support with async{}. I dont want to make the code public before > >first release so ill tell some details, if it wont help i will email some > > of you who really wants to help the code. So here it is, the main scripts > > gets all the vulnerability check, ie vulnerable file checks from a file > > and tries them one by one on particular IIS webserver. Ony by one is > > really slow, so I implemented threads. As you may know if it is checking > > the webserver it surely will send HTTP requests for each vulnerable file. > > I use IO::Socket only, not HTTP support modules. > > > >As far as i can guess, the reason for crash is most probably not in the > > code but in the perl, perl threads support particularly and how interacts > > with my OS - windows 98. > > > >Any help is greatly appreciated. Thanks in advance. > > > >Respect, OkIDaN. > >___ > >Perl-Win32-Users mailing list > >[EMAIL PROTECTED] > >To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl threads crash perl
Seeing as noone else has responded to this, let me simply say that I tried to develop an application using Perl threads, and in my opinion, Perl threads are seriously broken. We had to re-write the application without threads. The main problem was that threads would die, but I found no reliable way of detecting this. Also, some advice I found on the web said that you shouldn't create too many threads - they weren't designed for that. However, there was no mention of what the limit might be, how to determine the limit, or how to discover whether thread creation succeeded or failed. All this means that if you want to create a couple of threads, it should (?) work, but beyond that, who knows? At 04:07 PM 7/29/2004, Nadjaf Kuliev wrote: When i tested my IIS vulnerability checker, it works perfecly, but when I added multitasking support, it starts good, bit by bit cpu noise increases then perl crases with unknown error. I didnt use fork(). I used builtin Threads support with async{}. I dont want to make the code public before first release so ill tell some details, if it wont help i will email some of you who really wants to help the code. So here it is, the main scripts gets all the vulnerability check, ie vulnerable file checks from a file and tries them one by one on particular IIS webserver. Ony by one is really slow, so I implemented threads. As you may know if it is checking the webserver it surely will send HTTP requests for each vulnerable file. I use IO::Socket only, not HTTP support modules. As far as i can guess, the reason for crash is most probably not in the code but in the perl, perl threads support particularly and how interacts with my OS - windows 98. Any help is greatly appreciated. Thanks in advance. Respect, OkIDaN. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs