[ic] Threaded perl (re: debian bug #203579)

Mike Heins mike at perusion.com
Sun Feb 27 02:14:43 EST 2005

Quoting Karl Schmidt (karl at xtronics.com):
> >>How are you testing it?
> >
> >
> >Running IC, and running the regression tests. It would not work before
> >with Fedora Core 1, and it does with Fedora Core 3.
> >
> What regression tests - can I get a hold of them?

They are in CVS under dist/test. They are a not *too* difficult to set up,
but you have to read the catalog.cfg to figure out/set the DBI DSNs to use
for the SQL tests.

I run them regularly whenever I make a change to the core. There
are only 157 tests, most of which check out ITL tags and the
session storage. 

> >
> >>>You can put this in your .bashrc for your interchange user:
> >>>
> >>>
> >>>At that point, try it out. If it works for you, fine. 
> >>
> >>How do I test for the problem?
> >
> >
> >Bottom line seems to be that some people want me to spend hours, days, or
> >weeks chasing this. I won't do it until I think it makes sense.
> I'm not asking that - I just want to know how to test for it myself.

I have been trying, perhaps not in the clearest fashion, to say that you
can't do that very easily. There are no repeatable symptoms that I know
of, and even if there were they would probably be debugged only in the C
code of the modules which trigger the faults.

It also may be dependent on the order in which you access data. Even
were you to find a repeatable case taking the next step to find where it
related to the threading code within Perl would probably be a job only
suitable for the author of the code. Without working closely with them,
it is nearly impossible.

Threading compilers and libraries are very, very difficult to produce
and even more difficult to debug. Pthreads on Linux has been around
since at least 1997, and only now has it started to round into pretty
good shape.

We have perhaps been ragging on Perl per se a bit much -- in all
likelihood, most of the remaining problems are in the C code of Perl's
modules. I know there have been many bugs fixed in DBI and the DBD
modules that related to threads. Those are in C.

You have been talking like you think C is easier than Perl to do thread-
safe code for -- in fact it is much, much harder because there are so
many different data types which require different types of pre-allocation.
All it takes is a referencing a bad pointer and boom, you are dead.

With Perl's ithreads model, if you have properly localized the variable
you cannot go wrong because it keeps track of that for you.

I will tell you what I will do -- I will put up a machine running
Fedora Core 3 and it's threaded Perl 5.8.5 (latest Interchange from
nightly build, MySQL 4.1.9, all latest modules from CPAN). It is at:


Anyone who wants to try and find symptoms can do so. Reports can come
here; I will not promise to respond. I will tell you that it currently
can take and mail out an order, at least. If there are to be problems I
am guessing the UI is the place to find them; or putting up a huge
database and doing queries against that.

But my official position remains that of the message you will get
when you compile DBI on a threaded perl:

    *** You are using a perl configured with threading enabled.
    *** You should be aware that using multiple threads is
    *** not recommended for production environments.

Looks like to me it runs to the point where we need a guinea pig
willing to put their production environment at risk. As it will run
slower and user more memory than a non-threaded Perl, it would take
a lot of altruism I don't have.

Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295  tollfree 800-949-1889 <mike at perusion.com>

Friends don't let friends use Outlook. -- Bob Blaylock

More information about the interchange-users mailing list