INSTALL @lib$+"SPAWNLIB"
DIM mystruct{one,two%,three&,four(3),five%(1,2),six&(9),flag%}
mystruct.one = 1.0
mystruct.two% = 2
mystruct.three& = 3
mystruct.four(1) = 4.0
mystruct.five%(0,2) = 5
mystruct.six&(4) = 6
PRINT mystruct.one, mystruct.two%, mystruct.three&, mystruct.four(1), ;
PRINT mystruct.five%(0,2), mystruct.six&(4)
spawn% = FN_spawn(PROCspawned(), mystruct{})
REPEAT WAIT 0 : UNTIL mystruct.flag%
PRINT mystruct.one, mystruct.two%, mystruct.three&, mystruct.four(1), ;
PRINT mystruct.five%(0,2), mystruct.six&(4)
PROC_unspawn(spawn%, mystruct{})
END
DEF PROCspawned(shared{})
shared.one += 1.0
shared.two% += 2
shared.three& += 3
shared.four(1) += 4.0
shared.five%(0,2) += 5
shared.six&(4) += 6
shared.flag% = 1
ENDPROC
DEF FN_SPAWNLIB_NumberOfProcessors
LOCAL _SYSTEM_INFO{}
REM Get Computer Information
DIM _SYSTEM_INFO{ wProcessorArchitecture%, \ Only lower word if valid: high word is wReserved - was dwOemID
\ dwPageSize%, \
\ lpMinimumApplicationAddress%, \
\ lpMaximumApplicationAddress%, \
\ dwActiveProcessorMask%, \
\ dwNumberOfProcessors%, \
\ dwProcessorType%, \
\ dwAllocationGranularity%, \
\ wProcessorLevel{l&,h&}, \
\ wProcessorRevision{l&,h&} }
SYS "GetSystemInfo", _SYSTEM_INFO{}
=_SYSTEM_INFO.dwNumberOfProcessors%