Is LWP thread-safe?

A

Agent2002

Hi,
I enjoyed LWP so much that it can help me automating nearly all the
tasks a web browser can do. I also found that combining LWP with Perl's
new multi-thread model "ithread" can improve the efficiency of my web
scripts significantly, about ten or more times faster, perhaps.
For example, I've written a Perl script that can download the latest
news from CNN.com very quickly since it uses ten threads every instant
and it works very fine and has never got any problem. However, the
script I wrote recently using LWP and ithread together crashes every
time when it has accessed a URL using sufficient proxies. And I always
get the following error message:
Free to wrong pool 15306e48 not 272770.
I really have no idea whether it is caused by the LWP module. Could any
one tell me doubtlessly the LWP module is thread-safe or not? Thank you
very much.
 
J

John Bokma

Agent2002 said:
Hi,
I enjoyed LWP so much that it can help me automating nearly all the
tasks a web browser can do. I also found that combining LWP with Perl's
new multi-thread model "ithread" can improve the efficiency of my web
scripts significantly, about ten or more times faster, perhaps.
For example, I've written a Perl script that can download the latest
news from CNN.com very quickly since it uses ten threads every instant
and it works very fine and has never got any problem. However, the
script I wrote recently using LWP and ithread together crashes every
time when it has accessed a URL using sufficient proxies. And I always
get the following error message:
Free to wrong pool 15306e48 not 272770.
I really have no idea whether it is caused by the LWP module. Could any
one tell me doubtlessly the LWP module is thread-safe or not? Thank you
very much.

Have you looked at the parallel useragent module? It doesn't use threads
(AFAIK), but does work in parallel (maybe less efficient)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top