in reply to threads->create hangs

So, the story so far is that some responders avoid the question of the warning against using threads in threads. Conversely, an anonymous poster claims the warning can simply be removed. My position is that the correct use of Perl threads and forks is best derived from the pre-existing theory (described surprisingly well on Wikipedia). I have two critics Tye and browserUK who on the one hand make no comment about this warning but are clearly knowledgable about the Perl implementation.

My challenge to anyone who wants to participate in the public interest is to engage with me in a competition to propose alternative and accurate documentation to threads that enables the reader to have a clear understanding of when to use threads versus forks. I don't set a time limit and I am starting my own efforts forthwith. Submissions, when ready should be linked in a reply to this topic.

One world, one people

Replies are listed 'Best First'.
Re^2: threads->create hangs
by ikegami (Patriarch) on Aug 17, 2015 at 01:42 UTC

    So, the story so far is that some responders avoid the question of the warning against using threads in threads.

    I asked p5p about that not long ago, and they very clearly said it's not a warning against using threads. It's a warning that threads aren't lightweight. If you're prepared to accept that, then use of threads is perfectly fine.

      Excellent, but then don't you think the documentation should more clearly present that view? If you had to ask, then it didn't do that for you originally, did it?

      One world, one people

Re^2: threads->create hangs (warning)
by tye (Sage) on Aug 17, 2015 at 01:29 UTC

    You can read a lot about the motivations for the creation of that warning (certainly in the p5p archive but also other places). It has more to do with many people having a difficult time using threads than with any specific problems with Perl's implementations of threads. Well, except for the heavy per-thread memory cost that is specific to Perl's implementation (which is the part you misread as saying that Perl threads don't use OS threads).

    It is meant to discourage casual use of threads and has more social motivations than technical. Have fun fighting with p5p on what to replace it with. I really do wish you luck (sincerely), but I am not interested in participating in that. I try to stick to activities where my strengths and weaknesses are more beneficial. The warning should certainly be made less likely to mislead.

    - tye        

      tye, many thanks for your sincere and informative response.

      One world, one people

Re^2: threads->create hangs
by Anonymous Monk on Aug 16, 2015 at 21:01 UTC

    So, the story so far is that some responders avoid the question of the warning against using threads in threads. Conversely, an anonymous poster claims the warning can simply be removed. My position is

    Your position is irrelevant as its not based on information/knowledge but propaganda

Re^2: threads->create hangs
by SimonPratt (Friar) on Aug 17, 2015 at 12:01 UTC

    I don't read it as a warning to not use threads. I read it as a warning that threads are not light-weight and people writing code using them are not likely to get much help.

    Through my own experience in writing threaded programs, I find the warning to be absolutely valid, although I suspect the number of people becoming proficient at using threads has grown somewhat since the warning was first written.

      Fair enough. Perhaps I am setting too high an expectation on the docs. The systems I worked on most recently have too trivial a usage of threads to be pushing the boundaries. So perhaps I should try creating a test set (destruction-testing ;)) for all the methods in the threads space - that might reveal whether there are specific problems that could be documented away - in my world there is such thing as a documentation problem i.e. what appears to be a bug isn't so long as it's documented properly - but for now I can't get past the fact that although some others clearly see it differently, I stare at those words and it's as if it is saying to me: 'abandon hope all ye who enter here!' - I can't remember anything else in perldoc that reads back at me anything even close to that.

      One world, one people