Synchronisation problem on shape update ? [whiteboard]

Avatar

Avatar

coulix

Avatar

coulix

coulix

18-08-2009

Hi all,

We had a problem with our own board and tried on AFCS youtube whiteboard sample who also seem to have it.

The recipe:

Get two users A and B on the board

  • Draw a square with A
  • User A resize the height of the square but to not do the 'mouse up action' which actualy publish to AFCS.
  • User B resize the width of the square but to not do the 'mouse up action' which actualy publish to AFCS.
  • At the same time A and B release the mouse up.

What you will have is two different states of the square shape a vertical rectangle on B and  horizontal rectangle on A.

There are not seing the same thing and that is a problem (isn'it ?)

What i think is happening behind the scene is the following:

AFCS receives an update from A on shape id #n,

It publishes it back to user A and B, A ignores it because it's an aciton coming from himself, and B updates its state with the message from A.

On the other side B publishes his state to AFCS, and A updates it.

(don't know how clear is this)

What we will try to fix this problem, is to update the shape even when the published message was from ourself.

What do you think ?

Thanks !

Greg

View Entire Topic

Avatar

Avatar

coulix

Avatar

coulix

coulix

19-08-2009

A last question about Whiteboard:

To handle Shape creation the WBmodel uses:

NodeConfiguration.STORAGE_SCHEME_MANUAL

Letting the clients set the shape ID.

Race condition which is actually handled well by the whiteboard is when user A creates a Shape with id #4 and B also creates a shape with the same id at the same time. Since they are using an internal increment counter to handle shape id this case may happen (at least it does in our whiteboard).

My questions are:

  1. Why not use NodeConfiguration.STORAGE_SCHEME_QUEUE to handle unique ids set by the server ?
  2. How do you manage to avoid this race condition ?

After that, i am set to fix our broken whiteboard

Thanks !