Many thanks for your reply, BrowserUk.

My project is neither urgent (I've been procrastinating for months now), nor mission critical, so I'm free to experiment and fiddle.

The project (named 'pancakes' due to the number of pancakes I consumed when I first had the idea) is a playlist framework 'thingy'. I'm still not sure exactly how pancakes will work, since I'm only in the early design phase, but I'm assuming that there will be forking/threading going on (typical setup of 1 thread for user interface, and 1 thread for doing the work).

I'm probably going to interact with mplayer (or perhaps XMMS2, if (stable) perl bindings ever get released for it). Not too keen on the alternatives (mpg123, etc), since they seem to only play mp3s/oggs (my playlist has all sorts of file formats in it). Interaction with mplayer will probably be done via system() or similar.

That's all I can really think of pancakes-wise (if anyone is interested and/or wants to help, feel very free to reply :-) ). It'll all be released under GPL, so whatever solution I find will be free for all. I'll probably also blog/wiki it (and if I make a good article, will post at the monastry).

From what has been said so far, it sounds like forking in a thread is unsafe, unportable, and unwise. I think the best thing in the given situation would be:

If I come up with any better ideas, I'll post another message :-)

Thanks to all who replied


In reply to Re^2: Using forks and threads by ColinHorne
in thread Using forks and threads by ColinHorne

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.