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.
In reply to Re: Sharing a Thread::Semaphore among threads
by BrowserUk
in thread Sharing a Thread::Semaphore among threads
by philou
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |