<<< Date Index >>>     <<< Thread Index >>>

Re: a Message-ID proposal



Paul Walker <paul@xxxxxxxxxxxxxxxxxxxxx>:

> > interactive mutt sends a message just before exiting, and a command-line
> > mutt sends a message half a second later; I would guess the two could have
> > the same process ID. So I'm just using a random "uniquifier".
> 
> PIDs just keep incrementing until the counter wraps. So that shouldn't be a
> problem.

As I wrote, it's a "long-running" interactive mutt. Assume there have
been about 65536 forks since it started. Perhaps some kernels have a
mechanism to prevent a process ID from being reused too quickly, but I
bet some kernels don't.

Perhaps you could test it like this:

Assuming you're not using sleep for something else important, in one
xterm type this, but don't hit return on the second command yet:

x=0 ; while [ $x -lt 100 ] ; do sleep 999999 & x=$[$x+1]; done
killall sleep

If you're using bash you should see a load of process IDs printed out.

In another xterm run this:

while true ; do sh -c 'echo $$' ; done | tee log

When the numbers are about to hit your block of sleepers, hit return
on the killall. Then examine the log to see if a process ID was
reused.

Edmund