sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Sox with multiple threads?
@ 2013-08-04 16:09 Christian Hoene
  2013-08-05 17:29 ` Ulrich Klauer
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Hoene @ 2013-08-04 16:09 UTC (permalink / raw)
  To: sox-devel


[-- Attachment #1.1: Type: text/plain, Size: 122 bytes --]

Hi,

 

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

 

Christian

 

 


[-- Attachment #1.2: Type: text/html, Size: 2111 bytes --]

[-- Attachment #2: Type: text/plain, Size: 417 bytes --]

------------------------------------------------------------------------------
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

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Sox with multiple threads?
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Klauer @ 2013-08-05 17:29 UTC (permalink / raw)
  To: sox-devel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Sox with multiple threads?
  2013-08-05 17:29 ` Ulrich Klauer
@ 2013-08-06  1:34   ` Christian Hoene
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Hoene @ 2013-08-06  1:34 UTC (permalink / raw)
  To: sox-devel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-05 19:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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).