From 236577af09149eb59e13b5ce325809a48ac93088 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 25 May 2013 15:03:30 +0200 Subject: cache: use threads instead of fork() Basically rewrite all the code supporting the cache (i.e. anything other than the ringbuffer logic). The underlying design is untouched. Note that the old cache2.c (on which this code is based) already had a threading implementation. This was mostly unused on Linux, and had some problems, such as using shared volatile variables for communication and uninterruptible timeouts, instead of using locks for synchronization. This commit does use proper locking, while still retaining the way the old cache worked. It's basically a big refactor. Simplify the code too. Since we don't need to copy stream ctrl args anymore (we're always guaranteed a shared address space now), lots of annoying code just goes away. Likewise, we don't need to care about sector sizes. The cache uses the high-level stream API to read from other streams, and sector sizes are handled transparently. --- configure | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'configure') diff --git a/configure b/configure index f01c515c54..d18d1cc547 100755 --- a/configure +++ b/configure @@ -493,7 +493,6 @@ libavdevice=auto _stream_cache=yes _priority=no def_dos_paths="#define HAVE_DOS_PATHS 0" -def_stream_cache="#define CONFIG_STREAM_CACHE 1" def_priority="#undef CONFIG_PRIORITY" need_shmem=yes _build_man=auto @@ -1452,9 +1451,11 @@ else fi echores "$_pthreads" -if cygwin || mingw32 ; then - _stream_cache=no - def_stream_cache="#undef CONFIG_STREAM_CACHE" +_stream_cache="$_pthreads" +if test "$_stream_cache" = yes ; then + def_stream_cache='#define CONFIG_STREAM_CACHE' +else + def_stream_cache='#undef CONFIG_STREAM_CACHE' fi echocheck "rpath" -- cgit v1.2.3