public void Work_speed(object threadId) { RandomPool radpool = new RandomPool(); Point pos = new Point(); string FilePath = strFilePath + "testfilespeed.csv"; string Output = null; StringBuilder sbAddress = new StringBuilder(); lock (radpool.rdPoolLock) { unsafe { for (int i = 0; i < speedvalue; i++) { pos.X = radpool.NextDouble(0.0000001, 65); pos.Y = radpool.NextDouble((Math.Pow(0.97, pos.X) * (500)) - 50, Math.Pow(0.97, pos.X) * (500) + 50); fixed(double *fixedX = &pos.X, fixedY = &pos.Y) { sbAddress.Append(string.Join(strSeperator, *fixedX, *fixedY, Environment.NewLine)); } } } } radpool.rdPoolSwappable = true; radpool.rdPoolOffset = RandomPool.rdPoolStaticAllocLen; Output = sbAddress.ToString(); File.AppendAllText(FilePath, Output); sbAddress = null; Output = null; }
public unsafe void Work_Weaving(object threadId) { RandomPool radpool = new RandomPool(); string FilePath = strFilePath + "Weavingtestfile.csv"; Point pos = new Point(); string Output = null; StringBuilder sbAddress = new StringBuilder(); lock (radpool.rdPoolLock) { unsafe { for (var i = 0; i < Weavingvalue; i++) { pos.X = radpool.NextDouble(0.0000001, 60); pos.Y = radpool.NextDouble((Math.Pow(pos.X, 2) * 0.25) - 7, ((Math.Pow(pos.X, 2) * 0.25) + 7)); fixed(double *fixedX = &pos.X, fixedY = &pos.Y) { sbAddress.Append(string.Join(strSeperator, *fixedX, *fixedY, Environment.NewLine)); } } } } radpool.rdPoolSwappable = true; radpool.rdPoolOffset = RandomPool.rdPoolStaticAllocLen; Output = sbAddress.ToString(); File.AppendAllText(FilePath, Output); sbAddress = null; Output = null; }