Originally posted by Koen Serneels:
Peter, if you looked at my version of the pseudo code, can you post your findings here if possible. I also have some other questions regarding this.
As for example: what do you do with the lockCookie in the unlock method ? There is nothing in your pseudo code that does something with it. And actually, can you do something withit in the unlock method ? I'm doing the cookie check not in the lockmanager but in the data class itself..
Originally posted by Anton Golovin:
Hi, Peter! I haven't thought on the merits of using the Thread object as the monitor. Now that you mention it should not be, I realize that there is no guarantee that the Thread run for lock is the same run for unlock with RMI (if you are using the rich client and exposing Data class to the client). So it is a bad idea. Even though the queue will provide the correct Thread, there is no way to insure there aren't more than one Thread waiting on it... I think. In the thin client, when one Thread runs the business method, it is conceivable, I think, but hardcoding this into the program is unwelcome, since then you are locked into one type of client... so it is a bad idea.
Alternatively, one could just make up a basic Object. Or whatever type of Object, to minimize memory consumption...
[ November 24, 2004: Message edited by: Anton Golovin ]