<PlatformTarget>AnyCPU</PlatformTarget>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
<Prefer32Bit>true</Prefer32Bit>
- <StartArguments>16</StartArguments>
+ <StartArguments>17</StartArguments>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
for i = 1 to 50_000_000 do
pos <- (pos + moves) % i + 1
if pos = 1 then valueAt1 <- i
- valueAt1
\ No newline at end of file
+ valueAt1
+
+// Four times slower than 'spinLock2'.
+let spinLock2' (moves : int) =
+ seq { 1 .. 50_000_000 }
+ |> Seq.fold (
+ fun (pos, valueAt1) i ->
+ let pos' = (pos + moves) % i + 1
+ pos', if pos' = 1 then i else valueAt1
+ ) (0, 0) |> snd
\ No newline at end of file