Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > single instance

Reply
Thread Tools

single instance

 
 
Twirlip of the Mists
Guest
Posts: n/a
 
      01-07-2013
On Sun, 06 Jan 2013 21:41:00 -0500, Arne Vajhøj wrote:

> On 1/6/2013 9:31 PM, Twirlip of the Mists wrote:
>> On Sun, 06 Jan 2013 21:19:59 -0500, Arne Vajhøj wrote:
>>
>>> On 1/6/2013 9:08 PM, Twirlip of the Mists wrote:
>>>> On Sun, 06 Jan 2013 20:58:45 -0500, Arne Vajhøj wrote:
>>>>> On 1/6/2013 8:46 PM, Twirlip of the Mists wrote:
>>>>>> On Sun, 06 Jan 2013 20:24:29 -0500, Arne Vajhøj wrote:
>>>>>>
>>>>>>> On 1/6/2013 7:22 PM, Twirlip of the Mists wrote:
>>>>>>>> On Sat, 05 Jan 2013 21:56:37 -0500, Arne Vajhøj wrote:
>>>>>>>>> On 1/4/2013 1:44 PM, Twirlip of the Mists wrote:
>>>>>>>>>> The concept of a PID is platform-agnostic -- all Unices seem to have it,
>>>>>>>>>> MacOS is a Unix nowadays, and newer Windowses have PIDs. It'd be surprising
>>>>>>>>>> if there isn't a platform-agnostic way to get at PIDs -- a POSIX call that
>>>>>>>>>> Windows supports, most likely.
>>>>>>>>>
>>>>>>>>> *nix and Windows support does not mean platform-agnostic.
>>>>>>>>
>>>>>>>> 1. When was the last time you, or anyone you know, bought or saw anyone
>>>>>>>> using a computer or other gadget that wasn't either Apple, Windows, or
>>>>>>>> some flavor of Unix?
>>>>>>>
>>>>>>> Yesterday.
>>>>>>
>>>>>> What operating system was it?
>>>>>
>>>>> OpenVMS
>>>>>
>>>>>> Do you think your experience at all typical
>>>>>> of the general population?
>>>>>
>>>>> No.
>>>>>
>>>>> But the fact that some platforms are not widely known does not make
>>>>> them non-existing.
>>>>
>>>> It does make them non-relevant. Planning for them is like planning for
>>>> waking up tomorrow and finding that everyone else on Earth has mysteriously
>>>> disappeared, leaving you the last person on the planet. It's not
>>>> theoretically *impossible*, but it's so unlikely it's not worth considering
>>>> unless it actually happens or you have specific knowledge to suggest it's
>>>> imminent.
>>> >
>>>> In this case, if you're designing a program for OpenVMS, consider OpenVMS.
>>>> If you're designing a program for generic use by the general civilian
>>>> population, consider Unix derivatives and Windoze.
>>>
>>> You mean consider Windows and MacOS X.
>>>
>>> That is what people in general use.

>>
>> Linux is used enough, especially on the server side, to cover, too, and
>> covering all Unixes isn't much harder than covering MacOS X, unless you
>> want a normal-looking native GUI, and with Java, using the native L&F
>> suffices for that.

>
> You need to decide what you want to talk about.
>
> If you want to consider "general civilian population" then go for
> Windows and MacOS X - they don't know what a server is.
>
> If you want to consider something else the say what it is.


What about "the vast majority of non-singletasking machines it's likely to
encounter, given it doesn't have an unusual specialized problem domain, and
that it can fairly easily be made to support"?

>>> But there are still a big difference between what has to work on all
>>> platforms and what happens to work on the most popular platforms.

>>
>> If anything genuinely and literally "has to work on all platforms" then
>> we're all ****ed.

>
> Yes.


Then you recognize the ridiculousness of your position. Good.

--
Hexapodia is the key insight.
 
Reply With Quote
 
 
 
 
Arne Vajhøj
Guest
Posts: n/a
 
      01-07-2013
On 1/6/2013 10:00 PM, Twirlip of the Mists wrote:
> On Sun, 06 Jan 2013 21:41:00 -0500, Arne Vajhøj wrote:
>
>> On 1/6/2013 9:31 PM, Twirlip of the Mists wrote:
>>> On Sun, 06 Jan 2013 21:19:59 -0500, Arne Vajhøj wrote:
>>>
>>>> On 1/6/2013 9:08 PM, Twirlip of the Mists wrote:
>>>>> On Sun, 06 Jan 2013 20:58:45 -0500, Arne Vajhøj wrote:
>>>>>> On 1/6/2013 8:46 PM, Twirlip of the Mists wrote:
>>>>>>> On Sun, 06 Jan 2013 20:24:29 -0500, Arne Vajhøj wrote:
>>>>>>>
>>>>>>>> On 1/6/2013 7:22 PM, Twirlip of the Mists wrote:
>>>>>>>>> On Sat, 05 Jan 2013 21:56:37 -0500, Arne Vajhøj wrote:
>>>>>>>>>> On 1/4/2013 1:44 PM, Twirlip of the Mists wrote:
>>>>>>>>>>> The concept of a PID is platform-agnostic -- all Unices seem to have it,
>>>>>>>>>>> MacOS is a Unix nowadays, and newer Windowses have PIDs. It'd be surprising
>>>>>>>>>>> if there isn't a platform-agnostic way to get at PIDs -- a POSIX call that
>>>>>>>>>>> Windows supports, most likely.
>>>>>>>>>>
>>>>>>>>>> *nix and Windows support does not mean platform-agnostic.
>>>>>>>>>
>>>>>>>>> 1. When was the last time you, or anyone you know, bought or saw anyone
>>>>>>>>> using a computer or other gadget that wasn't either Apple, Windows, or
>>>>>>>>> some flavor of Unix?
>>>>>>>>
>>>>>>>> Yesterday.
>>>>>>>
>>>>>>> What operating system was it?
>>>>>>
>>>>>> OpenVMS
>>>>>>
>>>>>>> Do you think your experience at all typical
>>>>>>> of the general population?
>>>>>>
>>>>>> No.
>>>>>>
>>>>>> But the fact that some platforms are not widely known does not make
>>>>>> them non-existing.
>>>>>
>>>>> It does make them non-relevant. Planning for them is like planning for
>>>>> waking up tomorrow and finding that everyone else on Earth has mysteriously
>>>>> disappeared, leaving you the last person on the planet. It's not
>>>>> theoretically *impossible*, but it's so unlikely it's not worth considering
>>>>> unless it actually happens or you have specific knowledge to suggest it's
>>>>> imminent.
>>>> >
>>>>> In this case, if you're designing a program for OpenVMS, consider OpenVMS.
>>>>> If you're designing a program for generic use by the general civilian
>>>>> population, consider Unix derivatives and Windoze.
>>>>
>>>> You mean consider Windows and MacOS X.
>>>>
>>>> That is what people in general use.
>>>
>>> Linux is used enough, especially on the server side, to cover, too, and
>>> covering all Unixes isn't much harder than covering MacOS X, unless you
>>> want a normal-looking native GUI, and with Java, using the native L&F
>>> suffices for that.

>>
>> You need to decide what you want to talk about.
>>
>> If you want to consider "general civilian population" then go for
>> Windows and MacOS X - they don't know what a server is.
>>
>> If you want to consider something else the say what it is.

>
> What about "the vast majority of non-singletasking machines it's likely to
> encounter, given it doesn't have an unusual specialized problem domain, and
> that it can fairly easily be made to support"?


Sure.

But the fact that "the vast majority" is most relevant is
pretty trivial.

>>>> But there are still a big difference between what has to work on all
>>>> platforms and what happens to work on the most popular platforms.
>>>
>>> If anything genuinely and literally "has to work on all platforms" then
>>> we're all ****ed.

>>
>> Yes.

>
> Then you recognize the ridiculousness of your position. Good.


The fact that a platform agnostic OS features do not exist
proves that I am right.

You can not get PID in a platform agnostic way.

Arne


 
Reply With Quote
 
 
 
 
Joshua Cranmer
Guest
Posts: n/a
 
      01-07-2013
On 1/6/2013 8:31 PM, Twirlip of the Mists wrote:
> Linux is used enough, especially on the server side, to cover, too, and
> covering all Unixes isn't much harder than covering MacOS X, unless you
> want a normal-looking native GUI, and with Java, using the native L&F
> suffices for that.


As someone who has worked with cross-platform native projects, I will
truthfully say that covering all Unixes can be much harder than just OS
X, since OS X uses different graphics libraries, filesystem conventions,
desktop environment APIs, and even a different linker/loader than the
most common Unix-based varieties.

>> But there are still a big difference between what has to work on all
>> platforms and what happens to work on the most popular platforms.

>
> If anything genuinely and literally "has to work on all platforms" then
> we're all ****ed.


Low-level platform details--like filesystems--are surprisingly
different, even between platforms claiming to confirm to POSIX; that's
why there exists massive libraries to try to paper over these
differences. Even where there are standards, there are cases where some
implementations purposefully ignore them (the NFS atomic file creation
issue is a famous one).

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
 
Reply With Quote
 
Twirlip of the Mists
Guest
Posts: n/a
 
      01-07-2013
On Sun, 06 Jan 2013 22:11:39 -0500, Arne Vajhøj wrote:

> On 1/6/2013 10:00 PM, Twirlip of the Mists wrote:
>> On Sun, 06 Jan 2013 21:41:00 -0500, Arne Vajhøj wrote:
>>
>>> On 1/6/2013 9:31 PM, Twirlip of the Mists wrote:
>>>> On Sun, 06 Jan 2013 21:19:59 -0500, Arne Vajhøj wrote:
>>>>
>>>>> On 1/6/2013 9:08 PM, Twirlip of the Mists wrote:
>>>>>> On Sun, 06 Jan 2013 20:58:45 -0500, Arne Vajhøj wrote:
>>>>>>> On 1/6/2013 8:46 PM, Twirlip of the Mists wrote:
>>>>>>>> On Sun, 06 Jan 2013 20:24:29 -0500, Arne Vajhøj wrote:
>>>>>>>>
>>>>>>>>> On 1/6/2013 7:22 PM, Twirlip of the Mists wrote:
>>>>>>>>>> On Sat, 05 Jan 2013 21:56:37 -0500, Arne Vajhøj wrote:
>>>>>>>>>>> On 1/4/2013 1:44 PM, Twirlip of the Mists wrote:
>>>>>>>>>>>> The concept of a PID is platform-agnostic -- all Unices seem to have it,
>>>>>>>>>>>> MacOS is a Unix nowadays, and newer Windowses have PIDs. It'd be surprising
>>>>>>>>>>>> if there isn't a platform-agnostic way to get at PIDs -- a POSIX call that
>>>>>>>>>>>> Windows supports, most likely.
>>>>>>>>>>>
>>>>>>>>>>> *nix and Windows support does not mean platform-agnostic.
>>>>>>>>>>
>>>>>>>>>> 1. When was the last time you, or anyone you know, bought or saw anyone
>>>>>>>>>> using a computer or other gadget that wasn't either Apple, Windows, or
>>>>>>>>>> some flavor of Unix?
>>>>>>>>>
>>>>>>>>> Yesterday.
>>>>>>>>
>>>>>>>> What operating system was it?
>>>>>>>
>>>>>>> OpenVMS
>>>>>>>
>>>>>>>> Do you think your experience at all typical
>>>>>>>> of the general population?
>>>>>>>
>>>>>>> No.
>>>>>>>
>>>>>>> But the fact that some platforms are not widely known does not make
>>>>>>> them non-existing.
>>>>>>
>>>>>> It does make them non-relevant. Planning for them is like planning for
>>>>>> waking up tomorrow and finding that everyone else on Earth has mysteriously
>>>>>> disappeared, leaving you the last person on the planet. It's not
>>>>>> theoretically *impossible*, but it's so unlikely it's not worth considering
>>>>>> unless it actually happens or you have specific knowledge to suggest it's
>>>>>> imminent.
>>>>> >
>>>>>> In this case, if you're designing a program for OpenVMS, consider OpenVMS.
>>>>>> If you're designing a program for generic use by the general civilian
>>>>>> population, consider Unix derivatives and Windoze.
>>>>>
>>>>> You mean consider Windows and MacOS X.
>>>>>
>>>>> That is what people in general use.
>>>>
>>>> Linux is used enough, especially on the server side, to cover, too, and
>>>> covering all Unixes isn't much harder than covering MacOS X, unless you
>>>> want a normal-looking native GUI, and with Java, using the native L&F
>>>> suffices for that.
>>>
>>> You need to decide what you want to talk about.
>>>
>>> If you want to consider "general civilian population" then go for
>>> Windows and MacOS X - they don't know what a server is.
>>>
>>> If you want to consider something else the say what it is.

>>
>> What about "the vast majority of non-singletasking machines it's likely to
>> encounter, given it doesn't have an unusual specialized problem domain, and
>> that it can fairly easily be made to support"?

>
> Sure.
>
> But the fact that "the vast majority" is most relevant is
> pretty trivial.


Then why are you harping on and on endlessly about it?

>>>>> But there are still a big difference between what has to work on all
>>>>> platforms and what happens to work on the most popular platforms.
>>>>
>>>> If anything genuinely and literally "has to work on all platforms" then
>>>> we're all ****ed.
>>>
>>> Yes.

>>
>> Then you recognize the ridiculousness of your position. Good.

>
> The fact that a platform agnostic OS features do not exist
> proves that I am right.
>
> You can not get PID in a platform agnostic way.


Using your very rigid definition of "platform agnostic", you can't do
anything in a platform agnostic way, not even add two and two. Using a
*useful* definition of "platform agnostic" -- say "runs on anything that
has an ANSI-compliant C compiler for it" or "runs on anything that has a
JLS-compliant JVM for it" -- it could conceivably be another story.

--
Hexapodia is the key insight.
 
Reply With Quote
 
Twirlip of the Mists
Guest
Posts: n/a
 
      01-07-2013
On Sun, 06 Jan 2013 21:39:27 -0600, Joshua Cranmer wrote:

> On 1/6/2013 8:31 PM, Twirlip of the Mists wrote:
>> Linux is used enough, especially on the server side, to cover, too, and
>> covering all Unixes isn't much harder than covering MacOS X, unless you
>> want a normal-looking native GUI, and with Java, using the native L&F
>> suffices for that.

>
> As someone who has worked with cross-platform native projects, I will
> truthfully say that covering all Unixes can be much harder than just OS
> X, since OS X uses different graphics libraries, filesystem conventions,
> desktop environment APIs, and even a different linker/loader than the
> most common Unix-based varieties.
>
>>> But there are still a big difference between what has to work on all
>>> platforms and what happens to work on the most popular platforms.

>>
>> If anything genuinely and literally "has to work on all platforms" then
>> we're all ****ed.

>
> Low-level platform details--like filesystems--are surprisingly
> different, even between platforms claiming to confirm to POSIX; that's
> why there exists massive libraries to try to paper over these
> differences. Even where there are standards, there are cases where some
> implementations purposefully ignore them (the NFS atomic file creation
> issue is a famous one).


Well, yes, if you try to make it work even on platforms that flagrantly
violate the relevant standards, then you're going to have problems. Making
a program that will work on systems that claim to support relevant
standards even if they in fact violate those standards is, in general, AI
complete; it's equivalent to making it work on arbitrary systems, since a
system that claims to follow, but violates, a standard is, when the opcodes
hit the CPU, no different from one that didn't even claim to follow any
standard at all. And no system, short of a human programmer's brain, is
known that's smart enough to port some code (itself, or something it's
acting as an installer for) to an arbitrary and novel system.

So the best you can typically do is program for a standard being respected,
and expect the code to be prone to fail on a system where the standard is
violated.

--
Hexapodia is the key insight.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-16-2013
On Sat, 05 Jan 2013 19:49:08 -0800, Knute Johnson
<> wrote, quoted or indirectly quoted someone
who said :

>
>The risk is, that in Windows anyway, where the system clock granularity
>is 17ms it is possible to start two copies of a program with a batch


I have been studying Knute's code and Peter's commentary hoping to
come up with a canned package for ensuring single Instance.

Using system.nanotime aught to help avoid granularity trouble.

I am puzzled about "227.228.229.230" the IP used. Where did that
value come from? Can this be made to work with IPV6?
--
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development
time.
~ Tom Cargill Ninety-ninety Law
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-16-2013
On Tue, 15 Jan 2013 22:51:45 -0800, Roedy Green
<> wrote, quoted or indirectly quoted
someone who said :

>
>I am puzzled about "227.228.229.230" the IP used. Where did that
>value come from? Can this be made to work with IPV6?


I discovered that 224.x.x.x - 239.x.x.x are reserved for IP multicast.
I could pick a random number in the range, or is it ok that everyone
uses the same IP or is it REQUIRED that everyone use the same IP

--
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development
time.
~ Tom Cargill Ninety-ninety Law
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-16-2013
On Tue, 15 Jan 2013 22:51:45 -0800, Roedy Green
<> wrote, quoted or indirectly quoted
someone who said :

>
>I have been studying Knute's code and Peter's commentary hoping to
>come up with a canned package for ensuring single Instance.


If you had two machines on a LAN, would they prevent the other from
running a new instance? You don't want, that, just on the same
machine.

If you wanted that behaviour -- e.g. to enforce a single instance
licence across the LAN, what do you do have make the all one group?
--
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development
time.
~ Tom Cargill Ninety-ninety Law
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-16-2013
On Tue, 15 Jan 2013 22:51:45 -0800, Roedy Green
<> wrote, quoted or indirectly quoted
someone who said :

>
>I am puzzled about "227.228.229.230" the IP used. Where did that
>value come from? Can this be made to work with IPV6?


This is beginning to come clear. This the name of the group. Everyone
sends and receives on the same socket on the same group.

Just as you have a problem assigning an unused socket, you have
assigning an unassigned group.

I don't see how this works between machines yet.

I think it should work like this:

You ask the OS , please assign me a free port. Here is a UUID. If
anyone asks for a port presenting the same UUID, please give him the
same one, no matter if he is calling from within the machine or
without. With such a scheme, you would not need reserved ports
(except for the port assigning port), and you could not have
collisions. Internally arrays of sockets could be dense. You can
then hard code in UUIDs into apps. Users don't need to worry about
collisions. Perhaps in IPV8.


--
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development
time.
~ Tom Cargill Ninety-ninety Law
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-16-2013
On Wed, 16 Jan 2013 00:13:06 -0800, Peter Duniho
<> wrote, quoted or indirectly quoted
someone who said :

>You wouldn't need the OS to associate a UUID with a port; the UUID would
>_be_ the port.


the UUID would be the port. The 16-bit port would just be an shorthand
abbreviation for it. You could even have a hybrid system. The
assigner just avoids well known ports or ports that have been
explicitly assigned.

don't port numbers appear in UDP packets and TCP/IP packets, though
the assignment of them may not be part of the protocol?

RFC 322 says that UCLA will maintain the list of reserved port
numbers.
--
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development
time.
~ Tom Cargill Ninety-ninety Law
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Taglib problems - instead of a single instance per page, I have a single instance per application. chris brat Java 1 05-10-2006 11:16 AM
Problem when subclass instance changes base class instance variable Gerry Sutton Python 1 04-16-2005 06:06 AM
Accessing an instance via its memory address (instance at ...) Kent Johnson Python 4 11-13-2004 07:42 PM
converting base class instance to derived class instance Sridhar R Python 14 02-10-2004 02:47 PM
Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class. DJ Dev ASP .Net 3 02-08-2004 04:19 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57