J
Johan Ovlinger
Subject says it all, really.
Can someone please confirm that I can safely do something like the below,
without needing a thread-local compiled regexp? (not run, so probably rife
with syntax errors, but you get the drift)
global_var = re.compile( "foo" )
for str in manystrings:
def domatch(str):
if global_var.search(str):
print "yahooo!"
threading.thread(target = domatch, args = [str]).start()
Alternately, what is the overhead in compilation? Neglible?
Thanks,
Johan
Can someone please confirm that I can safely do something like the below,
without needing a thread-local compiled regexp? (not run, so probably rife
with syntax errors, but you get the drift)
global_var = re.compile( "foo" )
for str in manystrings:
def domatch(str):
if global_var.search(str):
print "yahooo!"
threading.thread(target = domatch, args = [str]).start()
Alternately, what is the overhead in compilation? Neglible?
Thanks,
Johan