juddi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Hablutzel" <...@hablutzel.com>
Subject RE: [jUDDI-developers] JavaUUIDGen
Date Wed, 23 Jan 2002 06:56:14 GMT
A big difference - if multiple JVMs are running with the UUID server at the
same time. Synchronization is localized to a JVM, so you would have a race
condition if multiple JVMs are running (particularly on multiple-CPU

Obtaining a system-wide resource lock prevents this race condition.


-----Original Message-----
From: Maarten Coene [mailto:MacBelgium@ToughGuy.net]
Sent: Wednesday, January 23, 2002 9:42 AM
To: Bob Hablutzel; juddi-developers@lists.sourceforge.net
Subject: RE: [jUDDI-developers] JavaUUIDGen


looks interesting, but it seems like a sort of hack to me. I was wondering:
is there a difference between making the JavaUUIDGen class a Singleton
together with a synchronized nextUUID() method and your proposal?


At 08:44 23/01/2002 -0500, Bob Hablutzel wrote:
>Maarten -
>     The basic idea was to use a system resource that imposes locking
>semantics, since Java doesn't provide direct access to low-level
>locking constructs. So, for example, a TCP/IP port can only be bound by one
>thread of execution at once; a file can atomically be created if it didn't
>exist, and so forth.
>     The implementation I was working on used server sockets as the locking
>mechanism. It looks something like this:
>         obtain lock:            ServerSocket lock = new ServerSocket(
8090 );
>       release lock:           lock.close(); lock = null;
>     So far, it's worked on both NT and Linux; I can test it under Solaris
>a day or so. Interestingly, the latency isn't bad at all. I was worried
>about the reopen time-out of TCP ports, but that seems to only apply only
>you actually accept connections. Since the lock only requires a bind (which
>is system-wide locking), you can obtain pretty good lock performance.
>     Let me know if you want me to code this up further, or if you have any
>other comments.
>take care,
>-----Original Message-----
>From: juddi-developers-admin@lists.sourceforge.net
>[mailto:juddi-developers-admin@lists.sourceforge.net]On Behalf Of
>Maarten Coene
>Sent: Wednesday, January 23, 2002 3:29 AM
>To: Bob Hablutzel; juddi-developers@lists.sourceforge.net
>Subject: RE: [jUDDI-developers] JavaUUIDGen
>sounds interesting, and it seems a good idea since you'll probably get 2
>equal UUIDs when you call the nextUUID() method at the same time twice on
>the same node (since the time and the ethernet address are the same)
>At 20:15 22/01/2002 -0500, you wrote:
> >Maarten - I was just starting to look at putting in place a global
> >mechanism to ensure that you never got duplicate UUIDs on a node. If you
> >want to talk about the idea I had, it would be pretty quick to
implement -
> >drop me a note.
> >
> >hab
>Maarten Coene
>Katholieke Universiteit Leuven
>Dept. Computerwetenschappen             Tel: ++32 (0)16/32 78 25
>Celestijnenlaan 200A
>B-3001 Heverlee
>juddi-developers mailing list
>juddi-developers mailing list

Maarten Coene
Katholieke Universiteit Leuven
Dept. Computerwetenschappen             Tel: ++32 (0)16/32 78 25
Celestijnenlaan 200A
B-3001 Heverlee

View raw message