But, you have said it yourself, in here
That's not the point. The points are:
- He posted his code as a "correction" to mine; which by the logic and practice of basic Locking & Syncing; his code is broken, by design, everywhere.
Even if it never hangs on Linux -- and no one has convinced me that it won't eventually -- it is still broken on Linux, be it is a logical nonsense.
It makes no sense to run two threads; and then constrain them to only ever allowing one of them to do anything at a time. None whatsoever.
That it demonstrates its brokenness so quickly and obviously on Windows is just a side issue.
- He posted: "For me, it works fine in Windows too."; when he knew better.
...
Would it be possible to share this knowledge, to outline the guiding principles and design considerations, so as to allow us to build robust, working solutions ourselves, all the while avoiding the dangerous pitfalls, taboos and uncertainties? Much obliged!
I assume that is sarcasm. But, the answer is no. I have no idea how to condense and neatly parcel up 13 years of Perl threading experience; let alone the accumulated knowledge, feel and intuition from writing literally hundreds of threaded programs, big & small, in C, C++, Java, and half a dozen or more other languages that I've done since I wrote my first threaded program under OS/2 in 1987.
Maybe in the future they'll be able to do brain dumps; till then, the only way I know of to learn stuff, is to use it. For real.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
In the absence of evidence, opinion is indistinguishable from prejudice.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.