unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Sylvain Beucler <beuc@beuc.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guile-user@gnu.org
Subject: Re: Long-lived Guile scripts in a mono-threaded game engine
Date: Tue, 27 May 2008 21:57:07 +0200	[thread overview]
Message-ID: <20080527195707.GA19385@perso.beuc.net> (raw)
In-Reply-To: <87bq2rhb63.fsf@gnu.org>

Hi,

Thanks for your answers Ludovic and Clinton.


> An alternative approach could use a thread per script.

By the way, I have a question about threads: is there a way to kill a
running thread? For example when the current game screen changes, all
current scripts are terminated. Or does this need to be implemented
manually?


> > Yeah, I was trying to avoid introducing threads in the engine :)
> > But it sounds like the only usable solution as of now.
> 
> It's actually not silly now that we've entered the multicore era.

That's a pro, but there are cons too :/
- this kind of game engine has hardly anything runnable in parallel
- all the game globals need to be properly mutex'd
- or threads executions need to be serialized which defeats the point
Another pro though is that all of us masochists love debugging
multithread programs ;)


I'll try these solutions with my toy project and see how they fair
with performances/complexity :)

Thanks,

-- 
Sylvain




  reply	other threads:[~2008-05-27 19:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-26 21:19 Long-lived Guile scripts in a mono-threaded game engine Sylvain Beucler
2008-05-27  7:58 ` Ludovic Courtès
2008-05-27  8:33   ` Sylvain Beucler
2008-05-27 13:20     ` Ludovic Courtès
2008-05-27 16:14       ` Sylvain Beucler
2008-05-27 18:08         ` Ludovic Courtès
2008-05-27 19:57           ` Sylvain Beucler [this message]
2008-05-27 20:30             ` Clinton Ebadi
2008-05-27 18:19         ` Clinton Ebadi
2008-05-27 21:49           ` Neil Jerram
2008-05-27 13:42     ` Paul Emsley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080527195707.GA19385@perso.beuc.net \
    --to=beuc@beuc.net \
    --cc=guile-user@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).