unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Cooperative POSIX threads?
@ 2002-10-21 15:46 Marius Vollmer
  2002-10-21 18:01 ` Mikael Djurfeldt
  2002-10-21 20:39 ` Rob Browning
  0 siblings, 2 replies; 5+ messages in thread
From: Marius Vollmer @ 2002-10-21 15:46 UTC (permalink / raw)


Hi,

I noticed that signal delivery does not really work when using coop
threads together with the LinuxThreads compatability workaround (i.e,
when configured --with-threads=coop and --enable-linuxthreads)

While pondering what to do, I thought about the following:

Let's make another thread suport option, "coop-pthreads" that will use
pthreads for implementing threads but will rig it so that all threads
that use Guile are executing cooperatively.

There will be new C functions that will bring a thread into Guile
land, and make it leave again.  While a thread is in Guile land, it
can call Guile functions, etc.  When it is outside, it can't.  Threads
created by Guile itself will start in Guile land.  scm_boot_guile and
scm_init_guile will do the right thing, but I'm not yure yet what that
is for scm_init_guile.

We will need these Guile entering and leaving functions anyway when we
want external threads to use Guile since we need to know about the
relevant stack segments.  Those functions can take care that only one
thread is in Guile land at the same time.

Later the coop restriction can be lifted, when Guile itself can
survive this.

Thoughts?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cooperative POSIX threads?
  2002-10-21 15:46 Cooperative POSIX threads? Marius Vollmer
@ 2002-10-21 18:01 ` Mikael Djurfeldt
  2002-10-21 18:47   ` Marius Vollmer
  2002-10-21 20:39 ` Rob Browning
  1 sibling, 1 reply; 5+ messages in thread
From: Mikael Djurfeldt @ 2002-10-21 18:01 UTC (permalink / raw)
  Cc: guile-devel

Marius Vollmer <mvo@zagadka.ping.de> writes:

> I noticed that signal delivery does not really work when using coop
> threads together with the LinuxThreads compatability workaround (i.e,
> when configured --with-threads=coop and --enable-linuxthreads)

Just curious: In what sense doesn't it work?


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cooperative POSIX threads?
  2002-10-21 18:01 ` Mikael Djurfeldt
@ 2002-10-21 18:47   ` Marius Vollmer
  2002-10-21 19:52     ` Mikael Djurfeldt
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Vollmer @ 2002-10-21 18:47 UTC (permalink / raw)
  Cc: guile-devel

Mikael Djurfeldt <mdj@kvast.blakulla.net> writes:

> Marius Vollmer <mvo@zagadka.ping.de> writes:
> 
> > I noticed that signal delivery does not really work when using coop
> > threads together with the LinuxThreads compatability workaround (i.e,
> > when configured --with-threads=coop and --enable-linuxthreads)
> 
> Just curious: In what sense doesn't it work?

It segfaults when there is more than one thread running.  Try

  guile> (begin-thread (let loop () (loop)))
  guile>

and then hitting C-c.

Maybe this is easy to solve (maybe it's a readline problem), but I'm
currently so enthused by my coop-pthread plan that I'd rather hack on
that... :-) Should give me enough opportunity to practice pthread
debugging.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cooperative POSIX threads?
  2002-10-21 18:47   ` Marius Vollmer
@ 2002-10-21 19:52     ` Mikael Djurfeldt
  0 siblings, 0 replies; 5+ messages in thread
From: Mikael Djurfeldt @ 2002-10-21 19:52 UTC (permalink / raw)
  Cc: djurfeldt, guile-devel

Marius Vollmer <mvo@zagadka.ping.de> writes:

> Mikael Djurfeldt <mdj@kvast.blakulla.net> writes:
> 
> > Marius Vollmer <mvo@zagadka.ping.de> writes:
> > 
> > > I noticed that signal delivery does not really work when using coop
> > > threads together with the LinuxThreads compatability workaround (i.e,
> > > when configured --with-threads=coop and --enable-linuxthreads)
> > 
> > Just curious: In what sense doesn't it work?
> 
> It segfaults when there is more than one thread running.  Try
> 
>   guile> (begin-thread (let loop () (loop)))
>   guile>
> 
> and then hitting C-c.

Sigh... this has worked before.  But when testing it, it occurs even
in version 1.4.

> Maybe this is easy to solve (maybe it's a readline problem), but I'm
> currently so enthused by my coop-pthread plan that I'd rather hack on
> that... :-) Should give me enough opportunity to practice pthread
> debugging.

:-)

Sounds good to me.

Mikael


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cooperative POSIX threads?
  2002-10-21 15:46 Cooperative POSIX threads? Marius Vollmer
  2002-10-21 18:01 ` Mikael Djurfeldt
@ 2002-10-21 20:39 ` Rob Browning
  1 sibling, 0 replies; 5+ messages in thread
From: Rob Browning @ 2002-10-21 20:39 UTC (permalink / raw)
  Cc: guile-devel

Marius Vollmer <mvo@zagadka.ping.de> writes:

> I noticed that signal delivery does not really work when using coop
> threads together with the LinuxThreads compatability workaround (i.e,
> when configured --with-threads=coop and --enable-linuxthreads)
>
> While pondering what to do, I thought about the following:
>
> Let's make another thread suport option, "coop-pthreads" that will use
> pthreads for implementing threads but will rig it so that all threads
> that use Guile are executing cooperatively.

At this point, how many platforms are there that support libqthreads
and guile, but not posix threads?  If there aren't any and presuming
your idea works out, could we just drop qthreads in favor of posix
threads?  What would be the tradeoffs?

(I'd love to get rid of the qthread per-platform special-casing in
 debian/rules.)

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-21 20:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-21 15:46 Cooperative POSIX threads? Marius Vollmer
2002-10-21 18:01 ` Mikael Djurfeldt
2002-10-21 18:47   ` Marius Vollmer
2002-10-21 19:52     ` Mikael Djurfeldt
2002-10-21 20:39 ` Rob Browning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).