sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: "Christian Hoene" <christian.hoene@symonics.com>
To: <sox-devel@lists.sourceforge.net>
Subject: Re: Sox with multiple threads?
Date: Tue, 6 Aug 2013 03:34:55 +0200	[thread overview]
Message-ID: <000601ce9245$28e30b50$7aa921f0$@symonics.com> (raw)
In-Reply-To: <20130805192909.Horde.shFoKtY3aZLr6gNjs7trXw2@webmail.df.eu>

Danke!

-----Ursprüngliche Nachricht-----
Von: Ulrich Klauer [mailto:ulrich@chirlu.de] 
Gesendet: Montag, 5. August 2013 19:29
An: sox-devel@lists.sourceforge.net
Betreff: Re: [SoX-devel] Sox with multiple threads?

Christian Hoene wrote:

> One question. Is sox reentrant. Can I fork a sox program and run two 
> sox chains in parallel?

When you call fork(), the address space is duplicated, so unless there are
already open files, the processes are completely independent.  
Re-entrancy, on the other hand, is hardly relevant.

I guess what you really mean is thread safety. Unfortunately, libSoX uses
some global state and is thus not completely thread-safe; even running two
different chains in parallel in a single thread may lead to problems.
However, if you
a) use the same settings (buffer size etc.) for all chains,
b) don't rely on the "subsystem" information in the message handler (either
set verbosity to 0 or use a custom handler that doesn't read the subsystem
value),
c) don't mind a bit of extra randomness (read: race conditions) in the
pseudo-random number generator, then it will probably work.

Ulrich


----------------------------------------------------------------------------
--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk

      reply	other threads:[~2013-08-05 19:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-04 16:09 Sox with multiple threads? Christian Hoene
2013-08-05 17:29 ` Ulrich Klauer
2013-08-06  1:34   ` Christian Hoene [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000601ce9245$28e30b50$7aa921f0$@symonics.com' \
    --to=sox-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).