Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1244969

Re: [Linux] Linux PID algorithm is BRAINDEAD!

From Dave Goel <deego3@gmail.com>
Newsgroups linux.kernel
Subject Re: [Linux] Linux PID algorithm is BRAINDEAD!
Date 2015-10-12 20:00 +0200
Message-ID <qiPyb-6fF-35@gated-at.bofh.it> (permalink)
References <qhRLI-3BY-9@gated-at.bofh.it> <qialk-5a5-3@gated-at.bofh.it> <qisUW-71l-15@gated-at.bofh.it> <qiMTD-2Aw-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Ted,

Thanks for your patience with me.

I thought I had this down, and I thought that the only real
problem is *immediate* re-use and the race conditions it causes
and that for all other cases, scripts can find a way to work
around things. But:

But truly, your example stumps me atm.

Completely understood your point that the "real" solution is to
properly use trap in all scripts. What that also entails in practice is
working with every debian package and program .. .  If A calls B
that calls C which then calls D, and they are all programs
written in different languages, some of which don't even allow
arguments, etc.  But, indeed, that's not the kernel's "problem."


In the meanwhile, if deep inside D, I am generating files that A
needs to be aware of (again, A through D are in different
languages, with their own broken utilities), I can always add
additional information and make it unique.  I can use random
strings to make it unique enough, or if I need deterministic, I
can add pid + start time (jiffies of the proc) + linux start
time (btime from /proc/stat) to make it unique enough.  If I
truly have a unique PID, I never have to worry about any of this,
I guess.



OTOH, I guess if one has to write cleaner/other meta scripts without
proper traps, the cleaner can simply check if linux's PID counter
is too close to the current PID, and if so, refrain from drastic
actions. For the latter, I wonder if there's a way to
get "current PID counter."

Thanks again,
Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-10 04:10 +0200
  Re: [Linux] Linux PID algorithm is BRAINDEAD! yalin wang <yalin.wang2010@gmail.com> - 2015-10-10 05:30 +0200
  Re: [Linux] Linux PID algorithm is BRAINDEAD! Theodore Ts'o <tytso@mit.edu> - 2015-10-11 00:00 +0200
    Re: [Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-11 06:00 +0200
    Re: [Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-11 19:50 +0200
      Re: [Linux] Linux PID algorithm is BRAINDEAD! Theodore Ts'o <tytso@mit.edu> - 2015-10-12 17:10 +0200
        Re: [Linux] Linux PID algorithm is BRAINDEAD! Dave Goel <deego3@gmail.com> - 2015-10-12 20:00 +0200
          Re: [Linux] Linux PID algorithm is BRAINDEAD! Theodore Ts'o <tytso@mit.edu> - 2015-10-12 20:20 +0200

csiph-web