lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>> I fork a process, then call uuid:new() both in parent and in child. On
>> Ubuntu I get different results, on OS X generated UUIDs are the same.

> I'm not seeing what you think the problem is. Every UUID generated should
> be different from every other, and they look to be, and the order of
> stdout depends
> on OS scheduling.

> What about the behaviour concerns you?

Sorry for not being clear. On OS X box UUID series in parent and child processes are identical. I'll use fixed width font (sorry for HTML letter) and reorder lines in my example, so it is more apparent:

$ lua -lluarocks.require uuid-fork.lua
parent 1: DF9C3E77-1ACB-4B15-81C8-D0E3AB0A7B4B
child  1: DF9C3E77-1ACB-4B15-81C8-D0E3AB0A7B4B
parent 2: 68062AA2-721D-43FF-87D6-9007F9265C2A
child  2: 68062AA2-721D-43FF-87D6-9007F9265C2A
parent 3: 39EE9673-BE8D-4EB0-8C1D-2D22CBE94920
child  3: 39EE9673-BE8D-4EB0-8C1D-2D22CBE94920
parent 4: B895873C-B589-4944-AE16-39D811E28E5A
child  4: B895873C-B589-4944-AE16-39D811E28E5A
parent 5: DE5A1755-096B-4656-8001-F280DBB33358
child  5: DE5A1755-096B-4656-8001-F280DBB33358

This looks wrong to me. Also it (indirectly) breaks my tests. So I want to ask — is this normal, or my setup is broken?

Alexander.