single instance

T

Twirlip of the Mists

Obviously you did.

No, I did not.

He didn't.
Count the frequency of "program" and "process".

Counting the number of occurrences of some words without considering their
context is a meaningless metric.
*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?

2. How would you develop an OS without the concept of a PID? (No, the sucky
iPhone "OS" doesn't count, since it DOESN'T MULTITASK. :p)

3. Does anyone tend to make OSen (iPhone "OS" again does not count) that
*aren't* fairly POSIXy anymore?

4. And before you bring up some obscure legacy OS on some archaic mainframe
that some large banking institution in some obscure corner of the world
is still using to run some old bit of business logic for which they've
long since lost all the source code, recall that the context here is
*development of some new software*. Nobody sane develops *new* software
for clunkers like that -- they develop it for their farm of Unix servers
or their ten thousand cubicle boxen running Windows, even if maybe it
uses some network to get some service from the legacy mainframe.
It is important to keep in mind that even this approach is not 100%
reliable. UDP messages are not guaranteed delivery,

This is loopback interface we're talking about, not the wild wild internet.

Maybe you should have kept reading, [rest deleted unread]

You will need to be more polite and less judgmental if you want me to read
more of what you have to say.

Peter most likely does not care whether you read his posts or not.

It's starting to look like you don't either, which naturally causes one to
question why you bother writing them.
 
T

Twirlip of the Mists

Which does not contradict Peters statement.

Sure it does. Where is the packet going to run into congestion and get
dropped? What network cable will it travel over that might be damaged or
cut ahead of its path? It's probably more likely to try to use your
short-range baby monitor and get a busy signal.
 
A

Arne Vajhøj

Sure it does. Where is the packet going to run into congestion and get
dropped? What network cable will it travel over that might be damaged or
cut ahead of its path? It's probably more likely to try to use your
short-range baby monitor and get a busy signal.

Read the RFC.

No guarantee.

And not mention of an exception for loopback.

That you can not imagine it not being delivered means
nothing.

Arne
 
T

Twirlip of the Mists

I don't think any of these approaches are immune to system crashes, but
should be good enough to prevent single processes, whether launched by a
user or automatically by the system, from running more copies that are
wanted.

As I concluded at the end of my post.
I'd normally use a shell script or programmed equivalent to launch a more
complex set of processes. Its first action would be to assume a crash had
ocurred and do a full clean-up: if the system had shut down normally the
clean-up would still run but would not find anything to do.

That may make sense for a lot of systems.
Yes, that would work too: though it sounds as if the mere existence of a
small 'heartbeat' process could obviate the need for a lockfile:

Uh, something still has to point to the location of the heartbeat process.
Either that needs a fixed but configurable port, or else the lockfile (or
some sort of file, anyway) is needed (itself in a fixed location) to point
to the port-du-jour.
if the heartbeat process is running and agrees that the limit for your
process type hasn't been reached, your process can start.

"The limit for your process type"? That doesn't sound like you're thinking
of an app that should, by default, run as a single instance that "absorbs"
any more that the user triggers by e.g. double-clicking documents, more for
efficiency reasons or to avoid race conditions with its data files than for
any other reason. It sounds more like you're thinking of a situation
involving enforcing policy against users for reasons that have nothing to
do with those users' own wishes, say to limit their resource consumption on
a work computer that isn't theirs.

That's a whole different kettle of fish, but it's a kettle of fish best
handled at the OS level much of the time:

* The resource use at the guy's own cubicle box is his own business. If he
squanders it and then can't get his work done, he can be let go for poor
productivity or whatever.

* The resource use on shared machines, e.g. a network server supplying
services to a whole office block, can be managed by that machine's OS
having per-user quotas set up, if the users have accounts on it, or by
the server software enforcing quotas. The latter is similar to how a
publicly-exposed web service without authentication might prevent one
user hogging too many resources -- per-connecting-IP resource quotas past
which it slows down or times out, intentional latency high enough to
limit the damage a rampaging bot client can do from rapid-fire sequential
requests but low enough not to nuisance a human user with human reaction
times, etc.
Some situations likely in the wild 'net are much less so on the company
LAN, of course, such as the rampaging bot. And, if something that
egregious ever does occur, whoever's responsible can be fired.

In a workplace environment, with software customized for that particular
workplace, you can generally go much further in deciding things that users
should and should not do than with software intended for a general audience
including people running it on their own hardware with their own time and
paying their own utility bills.

Even then, it's often better to audit rather than strictly ration use, and
then hold employees accountable for unnecessary and excessive usage based
on the audit reports. Of all the different kinds of bureaucratic red tape
out there, the machine-enforced variety is easily the worst, because it's
typically *impossible* to circumvent without going through the proper
channels, even in direst emergency with some sort of looming deadline and,
with characteristically bad timing, the pointy-haired single point of
failure that holds the needed pad of permission slips home sick. In all
other situations, "contrition is easier than permission" should be a
possible approach, on pain of losing your job if your corner-cutting was
frivolous rather than out of good faith perceived necessity. Though it
certainly should not be the default.

(Of course, because machine-enforced red tape *is* so hard to circumvent,
the bureaucrats *really* love it...)

Another thing to note is that all of the possibly-limited computing
resources -- CPU, disk, memory, bandwidth -- are so cheap these days that a
company can easily afford to have internal servers with 10x or more
capacity than the likely peak load from normal employee use of its
services, such that it would take truly exceptional circumstances (a 10x
bigger than normal demand, or deliberate bad faith or a major malware
infestation) for it to be unable to meet demand. The result is that the
cost in enforcing quotas (or even in auditing usage, possibly) could
actually exceed the benefit (the cost in enforcing has to factor in the
eventuality of someone legitimately needing more than their quota, and the
relevant permission slip being slow or difficult to obtain, with a
deadline; and the cost of both has to factor in the added system complexity
and accompanying bugs; bugs in enforcement are quite likely to result in
people being locked out of the system that are *under* quota, since half of
errors can be expected to be in that direction).

The other limited resource is money, to pay for electricity and (external)
bandwidth whose use may go up. But with efficient hardware an employee
would have to cause very big jumps in server loads to cost noticeable
amounts of marginal hydro-bill dollars, and the firewall can work both ways
to make excessive use of external bandwidth unlikely. Business connections
tend to be non-metered anyway, so while congestion can be a problem overuse
won't directly cost money. (It might indirectly do so, if
revenue-generating public-facing services are knocked out. Those should
probably be on a separate pipe from the one feeding the offices' internet
connectivity, routed differently enough that congesting one won't impair
the other. That's equally important in reverse, so if the web server's
under a DDoS or unusually high legitimate demand it won't cripple the
office workers that need to deal with the problem by cutting them off from
email, Wikipedia, Google, et. al.)
 
A

Arne Vajhøj

No, I did not.

That has clearly been demonstrated.
He didn't.


Counting the number of occurrences of some words without considering their
context is a meaningless metric.

Well if a piece of text mentions the word program twice and do not
mention the word process, then it is a pretty good metric that
he is talking about programs not processes.

Arne
 
A

Arne Vajhøj

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.

2. How would you develop an OS without the concept of a PID? (No, the sucky
iPhone "OS" doesn't count, since it DOESN'T MULTITASK. :p)

Well - iOS is an OS.

It is possible to develop an OS without PID's.

DOS did not have PID's.
3. Does anyone tend to make OSen (iPhone "OS" again does not count) that
*aren't* fairly POSIXy anymore?

There are not that much point in not counting iOS.

But why do you keep excluding it?

iOS is POSIXy!
4. And before you bring up some obscure legacy OS on some archaic mainframe
that some large banking institution in some obscure corner of the world
is still using to run some old bit of business logic for which they've
long since lost all the source code, recall that the context here is
*development of some new software*. Nobody sane develops *new* software
for clunkers like that -- they develop it for their farm of Unix servers
or their ten thousand cubicle boxen running Windows, even if maybe it
uses some network to get some service from the legacy mainframe.

New code still get developed for mainframes.

And sane developers develop software for the platforms
they get paid to develop for.

BTW, z/OS is also POSIXy!

But nothing of this really matters. A feature being support by all
common platforms and a feature being platform-agnostic are two
different things.

Arne
 
L

Lew

Twirlip said:
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?

Happens all the time.
2. How would you develop an OS without the concept of a PID? (No, the sucky
iPhone "OS" doesn't count, since it DOESN'T MULTITASK. :p)

No True Scotsman. Throw away ahead of time all the valid counterexamples.
3. Does anyone tend to make OSen (iPhone "OS" again does not count) that

No True Scotsman. Throw away ahead of time all the valid counterexamples.
*aren't* fairly POSIXy anymore?

4. And before you bring up some obscure legacy OS on some archaic mainframe

No True Scotsman. Throw away ahead of time all the valid counterexamples.

Java runs today on some of your "archaic" mainframes.
that some large banking institution in some obscure corner of the world

Large *and* obscure?
 
A

Arne Vajhøj

Exactly what makes them so pernicious to fix.


That kind of thinking in software engineering has actually killed people.
Horridly and painfully.

On single-core CPUs, which are no longer so common, threading issues were
masked. They became evident to the point where Sun had to change the
instructions not only about initialization but construction, once multi-core
mobos became common some years ago. They even had to overhaul the entire
concurrency memory model. So "years without problems" is an utterly specious
argument.

I am pretty sure that it will still work if I try now.

But working 1 out 1 does not make the code correct.

Working 1 billion out of 1 billion does not make it correct.
It may be fine for your specific purpose, but if it has a concurrency bug
wired in I would not bet on it.

The point in software engineering is *not* to design for the "maybe there
won't be a problem this time" scenario.

True.

But I must plead guilty to having written code that were not so good.

Arne
 
T

Twirlip of the Mists

Yesterday.

What operating system was it? Do you think your experience at all typical
of the general population?
Well - iOS is an OS.

It is possible to develop an OS without PID's.

DOS did not have PID's.

DOS also lacked multitasking.

And lacking multitasking makes the issue of multiple concurrent instances
of a single program rather moot, wouldn't you say?
There are not that much point in not counting iOS.

See above.
iOS is POSIXy!

That, if true, just works in my argument's favor.
New code still get developed for mainframes.

I said "nobody sane", not "nobody". :)
But nothing of this really matters. A feature being support by all
common platforms and a feature being platform-agnostic are two
different things.

All common platforms is necessary, and in practice sufficient. Your
strictly-exact notion of "platform-agnostic" is so restrictive as to be
meaningless -- what would compile and run on both Windows 8 and Babbage's
difference engine?
 
T

Twirlip of the Mists

Happens all the time.


No True Scotsman. Throw away ahead of time all the valid counterexamples.


No True Scotsman. Throw away ahead of time all the valid counterexamples.

In the context of making a process not run in multi-instances, on iOS
you've already won, so it is indeed irrelevant to consider it. But thanks
for playing.
 
T

Twirlip of the Mists

Actually the "that" were intended to refer to Peter's claim not yours.

Aww, and now you're backpedaling away from the brink of conceding defeat.
So cute. Too bad you didn't start until after you'd already gone over the
side. :)
 
A

Arne Vajhøj

In the context of making a process not run in multi-instances, on iOS
you've already won, so it is indeed irrelevant to consider it.

But this subthread is not about how to ensure only
one instance.

This subthread is about whether there are or should be a platform
agnostic to get PID.

An iOS is perfectly valid in that context.

Arne
 
A

Arne Vajhøj

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.
DOS also lacked multitasking.

And lacking multitasking makes the issue of multiple concurrent instances
of a single program rather moot, wouldn't you say?

Yes.

But we are discussing PID.
See above.


That, if true, just works in my argument's favor.

Specifically yes.

Generally it confirms that you state information as fact when it is not.
I said "nobody sane", not "nobody". :)
Read.


All common platforms is necessary, and in practice sufficient. Your
strictly-exact notion of "platform-agnostic" is so restrictive as to be
meaningless -- what would compile and run on both Windows 8 and Babbage's
difference engine?

Congratulations you have realized that "platform-agnostic" is
pretty difficult to achieve.

Arne
 
T

Twirlip of the Mists

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. If you get specific
requests to make it work on OpenVMS, then maybe consider OpenVMS.

Anyway I find it hard to imagine OpenVMS doesn't have something rather
PID-like, and likely there's even a POSIX-compliant get PID call supported
just to make porting C programs easier. After all, they'd know that a lot
of functionality is being coded for other systems, much of it C code that
assumes POSIX and needs little more than that to make it work there too, so
there's a big upside and little downside to supporting common POSIX calls
when developing an OpenAnything.
Yes.

But we are discussing PID.

In the context of controlling concurrent instance count.
Specifically yes.

Generally it confirms that you state information as fact when it is not.

OK, now you've devolved into more or less explicitly calling me a liar, to
my face and in a public venue. That's crossing a line.

Rest deleted unread.
 
A

Arne Vajhøj

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.

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.
Anyway I find it hard to imagine OpenVMS doesn't have something rather
PID-like, and likely there's even a POSIX-compliant get PID call supported
just to make porting C programs easier. After all, they'd know that a lot
of functionality is being coded for other systems, much of it C code that
assumes POSIX and needs little more than that to make it work there too, so
there's a big upside and little downside to supporting common POSIX calls
when developing an OpenAnything.

OpenVMS has PID.

But your claim that everybody uses the most common platforms are
still untrue.
In the context of controlling concurrent instance count.

Not really.

The discussion was whether one could rely on being able to
get PID.

The answer is that you can not.

The fact that the question triggering the question is not
relevant in the negative cases does not change that.

To transform it to Java: whether Oracle will add the ability
to get PID in standard Java library does not depend
on what Roedy may use it for.

Arne
 
T

Twirlip of the Mists

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.
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 fucked. :)
OpenVMS has PID.

But your claim that everybody uses the most common platforms are
still untrue.

Which claim was that? MID? I don't remember making such a claim.
 
A

Arne Vajhøj

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.
If anything genuinely and literally "has to work on all platforms" then
we're all fucked. :)

Yes.

So please stop claiming that getting PID can be done platform
agnostic.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top