in reply to integrating Perl into a C program... that uses threads

I am not an experienced C programmer, but.... If all you need is regular expressions engine, then you should look into Perl Compatible Regular Expressions library rather than embedding Perl.

See Extending and Embedding Perl and Extending and Embedding Perl (and also the publisher's site) if insist on embedding Perl after all.