First off, I've never used Thread::Semaphore.

Part of the reason I've never used it is because to my knowledge, you cannot share objects between threads, but for Thread::Semaphore to be useful, you would need to be able to invoke the methods from multiple threads? And I don't believe that this will work.

From my perspective, almost everything in the Thread::* namespace was written for use with perl5005threads, which are now deprecated in favour of iThreads, because they never really worked properly.

As such, I think that everything in the Thread::* namespace should be withdrawn or if it is really iThreads compatible, be renamed into the threads::* namespace so that it becomes clear which of those packages in Thread::* are actually usable with iThreads.

Of course, this won't happen because the namespace nazis will say that having packages where the first element of the name is all lowercase will confuse people, because all lowercase is reserved for pragmas. The fact that 90% of the modules in the Thread::* namespace were never designed or tested for use with iThreads, which just makes people that try to use them with iThreads think that iThreads are broken. But then, most of those same "namespace nazis" don't believe that Perl should have ever had threads in the first place, wouldn't use them or promote them on principle, and therefore don't give a flying f*** about the confusion this stupid decision causes.

Of course, never having tried to use Thread::Semaphore (I never saw a the need for it), I could be completely wrong about it. Thread::Queue does work and I couldn't live without that module. Even so, the gist of my rant above remains true regardless.

Until something is done to segregate those modules that are designed, for and tested with, iThreads; from those that are left overs from 5005threads that will never work; from those that were designed to be used with Forks (a mechanisms for bypassing threads completely), that have never been tested for use with threads proper, all of the heroic effort by Arthur Bergman to get iThreads to where they are now will tend to be wasted, because people will be trying to use the wrong modules with iThreads and fall foul of the stupid namespace decisions.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

In reply to Re: Sharing a Thread::Semaphore among threads by BrowserUk
in thread Sharing a Thread::Semaphore among threads by philou

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.