Marco,
David, Allen, Edward, thanks for the suggestions but I want
to be able to sort theB records in the exact physical order
in which they occured.B Using the port or pid numbers could
potentially give me the wrong sequence should two events
occur within the same millisecond (unless it is ruled out
that this is not possible).
do you mean in the order in which the process trigger events occurred
or the order in which they write to disk?
Once you go sub-millisecond (eg: 3 trigger in the same millisecond) it
becomes very difficult to know which process will be first in line for
CPU, MEM, and I/O so I don't see how you can tell which will get first
bite at whatever scheme you use to allocate IDs.
I think this leaves you with a key composed of DATE and TIME (both
padded appropriately) and then an incrementing counter based on a READU
ELSE testing condition. This will give you a defined order for how
things get to disk but I don't think it will guaranteed that trigger
event A was before B was before C since the O/S can schedule things out
of order, B could come off the network first but be running on an
overloaded CPU.
Precisely because you don't have infinite resolution in your timestamps
there is ALWAYS the possibility however remote that two processes will
end up with the same timestamp.
And just to prove two processes can get the same timestamp (to the
millisecond), run this in separate windows got plenty of duplicate
timestamps.
Command is:
CBA OUTPUTID
PROGRAM CBA
* 1330 is arbitrary just pick an internal time some time into the future
so that both instances start at about the same time.
DIM X(10000)
LOOP UNTIL TIME() GT 1330 DO
REPEAT
FOR I = 1 TO 10000
X(I) = TIME()
NEXT I
ID = FIELD(@SENTENCE, " ", 2)
OPEN "CBFILE" TO FT ELSE STOP
MATWRITE X ON FT, ID
END
Sample of output I got was:
0001: 1330
0002: 1330
0003: 1330
0004: 1330
0005: 1330
0006: 1330.0001
0007: 1330.0001
0008: 1330.0001
0009: 1330.0001
0010: 1330.0001
0011: 1330.0001
0012: 1330.0001
0013: 1330.0001
0014: 1330.0001
0015: 1330.0001
0016: 1330.0001
0017: 1330.0001
0018: 1330.0001
0019: 1330.0001
0020: 1330.0001
0021: 1330.0001
0022: 1330.0001
and
0001: 1330
0002: 1330
0003: 1330
0004: 1330
0005: 1330
0006: 1330
0007: 1330
0008: 1330
0009: 1330
0010: 1330
0011: 1330
0012: 1330
0013: 1330
0014: 1330
0015: 1330
0016: 1330
0017: 1330
0018: 1330
0019: 1330
0020: 1330
0021: 1330
0022: 1330
what else would I be thinking about just after midnight,
Craig
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/