aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-08-28 14:43:30 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-08-28 14:43:30 -0400
commitd91328bc0c51c399b2a6926ba04cead7bccc67da (patch)
tree47c6e2837e09f039257404e5134bced3b1a5ea7a
parent76a36bc094b4939ed4d689c59c692154289f1ca5 (diff)
Warn about concurrency issues with message-passing
-rw-r--r--doc/manual.tex2
-rw-r--r--src/c/urweb.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/doc/manual.tex b/doc/manual.tex
index a5b9c44e..b223e02a 100644
--- a/doc/manual.tex
+++ b/doc/manual.tex
@@ -2033,6 +2033,8 @@ The $\mt{channel}$ and $\mt{send}$ operations may only be executed on the server
Clients and channels live only as long as the web browser page views that they are associated with. When a user surfs away, his client and its channels will be garbage-collected, after that user is not heard from for the timeout period. Garbage collection deletes any database row that contains a client or channel directly. Any reference to one of these types inside an $\mt{option}$ is set to $\mt{None}$ instead. Both kinds of handling have the flavor of weak pointers, and that is a useful way to think about clients and channels in the database.
+\emph{Note}: Currently, there are known concurrency issues with multi-threaded applications that employ message-passing on top of database engines that don't support true serializable transactions. Postgres 9.1 is the only supported engine that does this properly.
+
\section{Ur/Web Syntax Extensions}
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 641c6c83..5dc2ce5b 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -220,7 +220,6 @@ static void release_client(client *c) {
pthread_mutex_lock(&c->lock);
--c->refcount;
pthread_mutex_unlock(&c->lock);
-
}
static const char begin_msgs[] = "Content-type: text/plain\r\n\r\n";
@@ -3185,7 +3184,8 @@ void uw_commit(uw_context ctx) {
delta *d = &ctx->deltas[i];
client *c = find_client(d->client);
- assert (c != NULL && c->mode == USED);
+ assert (c != NULL);
+ assert(c->mode == USED);
client_send(c, &d->msgs, ctx->script.start, uw_buffer_used(&ctx->script));
}