Skip to content

Commit

Permalink
queue for processing locals in distr indexes
Browse files Browse the repository at this point in the history
git-svn-id: http://sphinxsearch.googlecode.com/svn/trunk@4433 8b96e2b9-35c5-2c16-bc47-5122d61876d4
  • Loading branch information
klirichek committed Dec 23, 2013
1 parent 38ac53d commit d98f7ea
Show file tree
Hide file tree
Showing 10 changed files with 311 additions and 62 deletions.
3 changes: 3 additions & 0 deletions config/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL

/* Whether we have internal atomic functions */
#undef HAVE_SYNC_FETCH_AND_ADD

/* Define to 1 if you have the <sys/epoll.h> header file. */
#undef HAVE_SYS_EPOLL_H

Expand Down
66 changes: 66 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6325,6 +6325,70 @@ done



# check for interlocked increment in linux

interlocked_prog="
int interlocked_routine ( )
{
volatile int ia=0;
__sync_fetch_and_add( &ia, 1 ); // atomic increment
}
int main ()
{
int m = interlocked_routine();
return 0;
}
"

# check the availability of needed function
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for interlocked builtins" >&5
$as_echo_n "checking for interlocked builtins... " >&6; }
if ${sphinx_cv_interlocked+:} false; then :
$as_echo_n "(cached) " >&6
else

if test "$cross_compiling" = yes; then :

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$interlocked_prog
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
sphinx_cv_interlocked=yes
else
sphinx_cv_interlocked=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$interlocked_prog
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
sphinx_cv_interlocked=yes
else
sphinx_cv_interlocked=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi


fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sphinx_cv_interlocked" >&5
$as_echo "$sphinx_cv_interlocked" >&6; }

# final check
if test x$sphinx_cv_interlocked = xyes; then

$as_echo "#define HAVE_SYNC_FETCH_AND_ADD 1" >>confdefs.h

fi



{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
$as_echo "" >&6; }
Expand Down Expand Up @@ -6362,6 +6426,8 @@ $as_echo "no" >&6; }
fi




# check for pthreads

pthread_prog="
Expand Down
34 changes: 34 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,38 @@ SPHINX_CHECK_DEFINE(F_SETLKW,fcntl.h)
AC_SEARCH_LIBS([dlopen],[dl dld],[],[])
AC_CHECK_FUNCS(dlopen dlerror)


# check for interlocked increment in linux

dnl helper that runs a test program and checks for success
interlocked_prog="

int interlocked_routine ( )
{
volatile int ia=0;
__sync_fetch_and_add( &ia, 1 ); // atomic increment
}

int main ()
{
int m = interlocked_routine();
return 0;
}
"

# check the availability of needed function
AC_CACHE_CHECK([for interlocked builtins], [sphinx_cv_interlocked],
[
AC_TRY_RUN($interlocked_prog, [sphinx_cv_interlocked=yes], [sphinx_cv_interlocked=no], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE($interlocked_prog)], [sphinx_cv_interlocked=yes], [sphinx_cv_interlocked=no])
])
])

# final check
if test x$sphinx_cv_interlocked = xyes; then
AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD,1,[Whether we have internal atomic functions])
fi

dnl --------------------------------------------------------------------------

SPHINX_CONFIGURE_PART([configuring Sphinx])
Expand Down Expand Up @@ -176,6 +208,8 @@ fi

dnl ---



# check for pthreads

dnl helper that runs a test program and checks for success
Expand Down
Loading

0 comments on commit d98f7ea

Please sign in to comment.