You are really asking for the impossible. Hoping that someone will be able to debug your code on the basis of a few hundred lines of debugger output.

Reading the sparse details of what you are doing (which is drowned in that sea of mostly useless debugger output), is this a fair summary of your application?

You have an application (Perl?) that forks a child process (Perl?) that:

Assuming that's correct, a couple of comments.

  1. Very few people (maybe 3 or 4 in the last 7+years), have come here describing code that combined both forking and threading in the same application.

    And of those 3 or 4, none have ever come back and described having successfully solved whatever problem they originally came here with.

    That doesn't mean they never did solve it, far too many posts here never get a "i finally solved it this way" summation, but it does tend to indicate that you are moving in what is fairly uncharted waters.

    That said, if the initial fork is done prior to any threads being spawned, and any subsequent re-fork of the parent is waiting until the initial child fork is complete, there's probably no great dangers with that.

    But note, that is just speculation, as I don't use any systems that support a true fork.

  2. Using DBI in multiple threads is historically, (and to the best of my knowledge still generally) considered a no-no.

    You describe: "In-order to maintain thread-safe manner( as DBI is not safe) I have made local to thread function whatever DBI object I am creating."

    Again, historically, this is not enough. Although logic implies that using different DBI instances from different threads should be "thread-safe"--and probably is at the Perl level--the real problems with thread-safety often lie in the vendor supplied C-libraries and XS wrappers around them. If they are not thread-safe internally, then there is little you, or the perl authors can do about it at the perl level.

    That does not mean that on your particular platform and DB vendor, that DBI isn't thread-safe, but it does mean that you should attempt to find out whether it is? And should perhaps assume it isn't until you get positive confirmation to the contrary.

None of this is very helpful, but it may give you cause for pause in assuming that what you are doing is inherently flawed or not. You might also try asking on DBI/Oracle news groups for further information.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re: perl ithread issue by BrowserUk
in thread perl ithread issue by elf_firein

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.