A
Aaron Davies
I'm developing a collaborative whiteboard, in which all objects
(shapes, clip art icons, etc.) are synchronized between all
participants in a session. It's working well, but I'm running into a
problem: if two people try to drag the same object at the same time,
nothing prevents them from doing so, and whichever one them lets go
first will have his move be the one that takes effect. (The other
person's client will probably crash at the moment, but that's just
from assertions.) Obviously, some form of locking is needed.
My question is not about the technical aspects _per se_, but more
about the UI aspects: I'm looking for suggestions on how best to
implement this so as not to annoy or confuse the user, while avoiding
the race conditions that tend to come with poor locking schemes.
Several possibilities have occured to me:
Before "picking up" an object, press a button to request a lock from
the server. (This is a client-server architecture, not peer-to-peer.)
If the object is not already locked, the server will grant you the
lock, and you can move it. This is probably the safest, but also the
most annoying and unintuitive, IMHO.
During the "pick up" (i.e., in the mousePressed handler), request the
lock, and until the lock is granted, block any movement of the object
(i.e., in the mouseDragged handler). This will result in the odd
behavior that the object will not move for 500ms or so, then suddenly
start.
Allow provisional motion while the lock status is being determined,
but only "commit" (during the mouseReleased handler) if the lock has
been granted; otherwise, discard the change and snap the object back
to its "official" position. This seems the closest to the way
client-server computer games (i.e., networked Quake, etc.) work, but I
don't know how well that would go over with the users.
Incidentally, both the latter options seem more race-prone than the
first (especially the last one).
Any comments on my ideas, or other suggestions for how to solve this
issue, would be much appreciated. Thanks!
(shapes, clip art icons, etc.) are synchronized between all
participants in a session. It's working well, but I'm running into a
problem: if two people try to drag the same object at the same time,
nothing prevents them from doing so, and whichever one them lets go
first will have his move be the one that takes effect. (The other
person's client will probably crash at the moment, but that's just
from assertions.) Obviously, some form of locking is needed.
My question is not about the technical aspects _per se_, but more
about the UI aspects: I'm looking for suggestions on how best to
implement this so as not to annoy or confuse the user, while avoiding
the race conditions that tend to come with poor locking schemes.
Several possibilities have occured to me:
Before "picking up" an object, press a button to request a lock from
the server. (This is a client-server architecture, not peer-to-peer.)
If the object is not already locked, the server will grant you the
lock, and you can move it. This is probably the safest, but also the
most annoying and unintuitive, IMHO.
During the "pick up" (i.e., in the mousePressed handler), request the
lock, and until the lock is granted, block any movement of the object
(i.e., in the mouseDragged handler). This will result in the odd
behavior that the object will not move for 500ms or so, then suddenly
start.
Allow provisional motion while the lock status is being determined,
but only "commit" (during the mouseReleased handler) if the lock has
been granted; otherwise, discard the change and snap the object back
to its "official" position. This seems the closest to the way
client-server computer games (i.e., networked Quake, etc.) work, but I
don't know how well that would go over with the users.
Incidentally, both the latter options seem more race-prone than the
first (especially the last one).
Any comments on my ideas, or other suggestions for how to solve this
issue, would be much appreciated. Thanks!