unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* guile fibers - looking for adivce
@ 2020-09-06  0:47 Jan Wielkiewicz
  2020-09-06  0:42 ` Zelphir Kaltstahl
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jan Wielkiewicz @ 2020-09-06  0:47 UTC (permalink / raw)
  To: guile-user

Hello,

I'm still on my way of integrating Guile Fibers and GOOPS, but I
encountered some weird behavior.
Say I have an object with with one slot being a vector and two methods
accessing the vector concurrently/parallelly. The methods
accessing/editing the vector are time consuming and are meant to be ran
frequently. Assuming I would like to run the methods on separate
fibers, how do I make sure the state of the object doesn't
suddenly change during execution of a method? I would like the methods
to be able to edit the state of the object, but in a cooperative manner.

The weird behavior I've encountered is that sometimes when running the
first method (A) and right after starting the second method (B), the
method B tries to access the vector before the method A finishes its
job. What should I do to make accessing the vector cooperatively, yet
to run the time consuming on separate fibers for concurrency?

I was thinking about implementing slots in objects as sending and
receiving messages instead of regular variables, but still there were
some problems with the object state.

Could someone explain me what should I do?


Thanks in advance
Jan Wielkiewicz



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

end of thread, other threads:[~2020-09-10  1:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-06  0:47 guile fibers - looking for adivce Jan Wielkiewicz
2020-09-06  0:42 ` Zelphir Kaltstahl
2020-09-07 16:34   ` Jan Wielkiewicz
2020-09-06  1:19 ` Aleix Conchillo Flaqué
2020-09-07 16:56   ` Jan Wielkiewicz
2020-09-08  0:25     ` Aleix Conchillo Flaqué
2020-09-08  7:48       ` Chris Vine
2020-09-08 17:56         ` Aleix Conchillo Flaqué
2020-09-10  1:05       ` Jan Wielkiewicz
2020-09-06 19:26 ` Chris Vine

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).