diff options
author | 2011-08-28 14:43:30 -0400 | |
---|---|---|
committer | 2011-08-28 14:43:30 -0400 | |
commit | eb1f7abebc8b0d88be660550258d5fe1e8610621 (patch) | |
tree | 47c6e2837e09f039257404e5134bced3b1a5ea7a | |
parent | 15ae1d4983d29b4268c3bcb25e291fe7bf1c33fc (diff) |
Warn about concurrency issues with message-passing
-rw-r--r-- | doc/manual.tex | 2 | ||||
-rw-r--r-- | src/c/urweb.c | 4 |
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)); } |