|
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
|
# ¿ Nov 19, 2007 11:22 |
|
|
# ¿ May 5, 2024 04:23 |
|
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.
|
# ¿ Dec 6, 2007 16:27 |