Thanks for all the suggestions, I'd like to quit gracefully if at all possible.
I guess I should have told you that this is a Win32 GUI (for a win32 version of my original version for *nix). So the Win32 response about terminating threads via the API is an interesting one.
However it's not just termination that's the problem. I was kind of hoping for a way of delivering immediate signals to the spider thread from the gui thread (like "Stop" or "Pause" and so on).
The only (kinda dodgy) solution I've come up with is to simply tell LWP (which I'm using to handle HTTP requests etc) to callback every 4kb and check if my flag is set. This seems to work a little better, but I guess this whole issue might count as an irritating problem with the current threads implementation, or I've just structured my code wrong from the beginning :). I don't know if threads under other APIs let you do this sort of thing, i'd be surprised if they didnt...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.