summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCedric BAIL <cedric@efl.so>2013-02-18 14:32:51 +0100
committerCedric BAIL <cedric@efl.so>2013-02-18 14:38:33 +0100
commit91711d8a694e53a95d164645b774de568ae4322b (patch)
treef9779e4e7d2efee19a1242f5c8efd5ea61c4f808 /configure.ac
parentceed029a84f695e93290addede0c8104bfbc8187 (diff)
ecore: add Ecore_Coroutine.
That work clearly was possible thanks to Leandro. If you want more information go to his blog : http://tia.mat.br/posts/async_io_with_coroutines/ . The main difference with his implementation is more portable and not thread safe. It does not have a custom swapcontext (would make sense as we don't need to save the sigcontext) so it will be less fast. If people are ready to contribute asm patch for that purpose I will be happy to apply them. As for portability this code should work on all architecture we already support thanks to a nice hack with setjmp/longjmp borowed from libcoroutine. We do use Fiber for Windows support, but as 1.8 is completely borken in that regard, this is theorical work only. Thinks left to do : - Eoify the API - Documentation - More tests - Add support for coroutine in fd handler - Add coroutine support to ecore_thread api - Write some example
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac45
1 files changed, 45 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3ab7427..31308a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1805,6 +1805,51 @@ fi
1805 1805
1806EFL_ADD_LIBS([ECORE], [${LTLIBINTL}]) 1806EFL_ADD_LIBS([ECORE], [${LTLIBINTL}])
1807 1807
1808# coroutine function specific
1809
1810AC_COMPILE_IFELSE(
1811 [AC_LANG_PROGRAM(
1812 [[
1813#include <ucontext.h>
1814 ]],
1815 [[
1816ucontext_t test;
1817getcontext(&test);
1818 ]])],
1819 [have_ucontext="yes"],
1820 [have_ucontext="no"])
1821
1822AC_MSG_CHECKING([for ucontext])
1823AC_MSG_RESULT([${have_ucontext}])
1824
1825AC_COMPILE_IFELSE(
1826 [AC_LANG_PROGRAM(
1827 [[
1828#include <setjmp.h>
1829 ]],
1830 [[
1831jmp_buf context;
1832setjmp(&context);
1833 ]])],
1834 [have_setjmp="yes"],
1835 [have_setjmp="no"])
1836
1837AC_MSG_CHECKING([for setjmp])
1838AC_MSG_RESULT([${have_setjmp}])
1839
1840if test "X${have_windows}" = "xyes"; then
1841 AC_DEFINE(USE_FIBER, 1, [Define to 1 if you have Windows Fiber support.])
1842 EFL_ADD_FEATURE([system], [coroutine], [fiber])
1843elif test "x${have_ucontext}" = "xyes"; then
1844 AC_DEFINE(USE_UCONTEXT, 1, [Define to 1 if you have posix ucontext functions.])
1845 EFL_ADD_FEATURE([system], [coroutine], [ucontext])
1846elif test "x${have_setjmp}" = "xyes"; then
1847 AC_DEFINE(USE_SETJMP, 1, [Define to 1 if you have setjmp/longjmp functions.])
1848 EFL_ADD_FEATURE([system], [coroutine], [setjmp])
1849else
1850 AC_MSG_ERROR([You don't have a working way to implement coroutine. Exiting...])
1851fi
1852
1808### Check availability 1853### Check availability
1809 1854
1810EFL_LIB_END([Ecore]) 1855EFL_LIB_END([Ecore])