unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* ice-9 format weirdness
@ 2003-06-24 16:16 Tatu Tarvainen
  2003-06-25  9:15 ` Matthias Koeppe
  2003-07-27 15:20 ` Marius Vollmer
  0 siblings, 2 replies; 3+ messages in thread
From: Tatu Tarvainen @ 2003-06-24 16:16 UTC (permalink / raw)



Hi,

I'm getting quite weird format errors:

--snip--
FORMAT: INTERNAL ERROR IN FORMAT:ERROR!
        format args: (#<input-output: socket 10> "HTTP/~A ~A ~A
" "1.0" 200 "OK")
        error args:  ("~a superfluous argument~:p" 3)
--snip--

I'm using Guile 1.6.4 and the problem seems to occur only when using
threads (serving pages with (net-http)) and even the simplest uses
of format result in similar errors.

When I substituted the offending format's to use simple-format, the
problem disappeared.

Is there a way to use format in multithreaded apps or do I have to stick
with simple format?

--
Tatu Tarvainen



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


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

* Re: ice-9 format weirdness
  2003-06-24 16:16 ice-9 format weirdness Tatu Tarvainen
@ 2003-06-25  9:15 ` Matthias Koeppe
  2003-07-27 15:20 ` Marius Vollmer
  1 sibling, 0 replies; 3+ messages in thread
From: Matthias Koeppe @ 2003-06-25  9:15 UTC (permalink / raw)
  Cc: guile-user

Tatu Tarvainen <ttarvain@mail.student.oulu.fi> writes:

> Is there a way to use format in multithreaded apps or do I have to stick
> with simple format?

The format procedure is not reentrant/threadsafe due to its use of
global variables that hold state during the formatting process
(format:port, format:output-col, and many more).

To make it threadsafe, one needs to change all these global variables
to fluid variables (and change all uses throughout format.scm).

-- 
Matthias Koeppe -- http://www.math.uni-magdeburg.de/~mkoeppe


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


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

* Re: ice-9 format weirdness
  2003-06-24 16:16 ice-9 format weirdness Tatu Tarvainen
  2003-06-25  9:15 ` Matthias Koeppe
@ 2003-07-27 15:20 ` Marius Vollmer
  1 sibling, 0 replies; 3+ messages in thread
From: Marius Vollmer @ 2003-07-27 15:20 UTC (permalink / raw)
  Cc: guile-user

Tatu Tarvainen <ttarvain@mail.student.oulu.fi> writes:

> Is there a way to use format in multithreaded apps or do I have to stick
> with simple format?

If you can use simple-format, stick to that.  Otherwise, you need to
wrap format with a mutex since it is not implemented in a thread-safe
way.

Of course, we need to eventually fix format to be thread-safe, and
speaking of this, we should probably just wrap it in a mutex in the
Guile sources...

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


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


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

end of thread, other threads:[~2003-07-27 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-24 16:16 ice-9 format weirdness Tatu Tarvainen
2003-06-25  9:15 ` Matthias Koeppe
2003-07-27 15:20 ` Marius Vollmer

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