Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
LOLLERZ
Dec 9, 2003
ASK ME ABOUT SPAMMING THE REPORT FORUM TO PROTECT ~MY WIFE'S~ OKCUPID PERSONALS ANALYSIS SA-MART THREAD. DO IT. ALL THE TIME. CONSTANTLY. IF SHE DOESN'T HAVE THE THREAD, SHE'LL WANT TO TALK TO ME!
I'm writing a wxPython application that deals with user-input regular expressions. Certain pathological regular expressions can take more than a few seconds (or forever) to terminate, and I want the UI to be responsive and allow the user to modify their regex during this computation. I have the regex in a separate thread, but it still seems to block the whole app while it's running.

How can I prevent a computationally intensive thread from blocking my whole app?

by the way, try matching this:
a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
against this:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Adbot
ADBOT LOVES YOU

LOLLERZ
Dec 9, 2003
ASK ME ABOUT SPAMMING THE REPORT FORUM TO PROTECT ~MY WIFE'S~ OKCUPID PERSONALS ANALYSIS SA-MART THREAD. DO IT. ALL THE TIME. CONSTANTLY. IF SHE DOESN'T HAVE THE THREAD, SHE'LL WANT TO TALK TO ME!

marcan posted:

I can see why that would take forever. The code matches all the a?s first, determines the string to be too short, and then starts trying all combinations for which a?s to consider or not (it isn't smart enough to figure out that they are all equivalent). My guess is the runtine is 2^30.
Very astute. There is a better way to match these though.

  • Locked thread