[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Guile threads vs GTK loop

From: Ondrej Zajicek
Subject: Guile threads vs GTK loop
Date: Sat, 31 Jul 2004 13:26:24 +0200
User-agent: Mutt/1.5.6+20040523i


I would like to use Guile (v1.6.4) in GTK app and i want running guile threads
while GTK main event loop is still active. If i execute from C code
begin-thread and return to C code, thread don't get any processor time. I can
call scm_yield() in GTK idle handler (handler called when no events are
available) to give some processor time to scheme threads, but i don't know
whether there are any running threads (i don't want call scm_yield() if there
aren't any).

Does anybody knows:

- How i can ask whether there are any running guile threads?
  (To deinstall idle handler where there aren't any.)
- How i can be informed (some hook?) whether any new running guile thread
  appeared? (To reinstall idle handler.)
- My Guile-exported C subroutines aren't reentrant. Is there a need to use any
locking? Happen guile thread switches even during call to C subroutines?

Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: address@hidden, jabber: address@hidden)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3,
"To err is human -- to blame it on a computer is even more so."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]