Greetings! I've tried to made guile module with glib's main_loop.
Following example below shows some strange interpreter freeze -- # cat test.c #include <glib.h> #include <libguile.h> SCM scm_test_mainloop() { GMainLoop *loop= g_main_loop_new(NULL, FALSE); g_main_loop_run(loop); } void scm_init_test(void) { scm_c_define_gsubr("test-mainloop", 0, 0, 0,(SCM(*)())scm_test_mainloop); } --- # gcc -fpic -shared `pkg-config glib-2.0 --cflags --libs` test.c -o # libguile-test.so # LD_LIBRARY_PATH=`pwd` guile guile> (+ 1 2) 3 guile> (dynamic-call "scm_init_test" (dynamic-link "libguile-test.so")) guile> (+ 1 2) 3 guile> (define z (begin-thread (test-mainloop))) guile> + #<primitive-generic +> guile> (+ 1 2) .... <freezing here> -- In strace log we see: -- ....... <guile eats (+ 1 2) here> ............. 23004 read(0, "\r", 1) = 1 23004 write(17, "\n", 1) = 1 23004 rt_sigprocmask(SIG_BLOCK, [INT], [RTMIN], 8) = 0 23004 ioctl(16, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0 23004 rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0 23004 rt_sigaction(SIGINT, {0xb7e17d90, [], SA_RESTART}, {0xb7e17d90, [], 0}, 8) = 0 23004 rt_sigaction(SIGTERM, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0 23004 rt_sigaction(SIGQUIT, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0 23004 rt_sigaction(SIGALRM, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0 23004 rt_sigaction(SIGTSTP, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0 23004 rt_sigaction(SIGTTOU, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0 23004 rt_sigaction(SIGTTIN, {SIG_DFL}, {0xb7e17d90, [], 0}, 8) = 0 23004 rt_sigaction(SIGWINCH, {SIG_DFL}, {0xb7e17d90, [], SA_RESTART}, 8) = 0 23004 close(16) = 0 23004 munmap(0xb7fd1000, 4096) = 0 23004 close(17) = 0 23004 munmap(0xb7fd0000, 4096) = 0 23004 time(NULL) = 1140441331 23004 rt_sigprocmask(SIG_SETMASK, NULL, [RTMIN], 8) = 0 23004 rt_sigsuspend([] <unfinished ...> ...... <main guile thread suspends and never returns> ... 23005 poll([{fd=10, events=POLLIN}], 1, 2000) = 0 23005 getppid() = 23004 23005 poll([{fd=10, events=POLLIN}], 1, 2000) = 0 23005 getppid() = 23004 23005 poll([{fd=10, events=POLLIN}], 1, 2000) = 0 23005 getppid() = 23004 23005 poll([{fd=10, events=POLLIN}], 1, 2000) = 0 .... <etc.> -- --- With best regards Stanislav Ievlev. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel