示例#1
0
        private void InitializeThreads()
        {
            threadHandle1 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(ComputeDelta),
                (IntPtr)GCHandle.Alloc(0),
                0,
                out threadId1
                );

            threadHandle2 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(ComputeFirstSolution),
                (IntPtr)GCHandle.Alloc(0),
                0,
                out threadId2
                );

            threadHandle3 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(ComputeSecondSolution),
                (IntPtr)GCHandle.Alloc(0),
                0,
                out threadId3
                );
        }
示例#2
0
        private void InitializeThreads()
        {
            threadHandle1 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(GetMinimumValueFromRow),
                (IntPtr)GCHandle.Alloc(0),
                0,
                out threadId1
                );

            threadHandle2 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(GetMinimumValueFromRow),
                (IntPtr)GCHandle.Alloc(1),
                0,
                out threadId2
                );

            threadHandle3 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(GetMinimumValueFromRow),
                (IntPtr)GCHandle.Alloc(2),
                0,
                out threadId3
                );

            threadHandle4 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(GetMinimumValueFromRow),
                (IntPtr)GCHandle.Alloc(3),
                0,
                out threadId4
                );

            threadHandle5 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(GetMinimumValueFromRow),
                (IntPtr)GCHandle.Alloc(4),
                0,
                out threadId5
                );

            threadHandle6 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(GetSmallestMinimum),
                IntPtr.Zero,
                0,
                out threadId6
                );
        }
示例#3
0
        private void InitializeThreads()
        {
            threadHandle1 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(ReadFile),
                (IntPtr)GCHandle.Alloc(1),
                0,
                out threadId1
                );

            threadHandle2 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(WriteToFile),
                (IntPtr)GCHandle.Alloc(2),
                0,
                out threadId2
                );
        }
示例#4
0
        private void InitializeThreads()
        {
            threadHandle1 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(IncrementGlobalCounter),
                (IntPtr)GCHandle.Alloc(1),
                0,
                out threadId1
                );

            threadHandle2 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(IncrementGlobalCounter),
                (IntPtr)GCHandle.Alloc(2),
                0,
                out threadId2
                );
        }
示例#5
0
        private void InitializeThreads()
        {
            threadHandle1 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(IncrementProgressBar),
                (IntPtr)GCHandle.Alloc(0),
                0,
                out threadId1
                );

            threadHandle2 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(IncrementProgressBar),
                (IntPtr)GCHandle.Alloc(1),
                0,
                out threadId2
                );

            threadHandle3 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(IncrementProgressBar),
                (IntPtr)GCHandle.Alloc(2),
                0,
                out threadId3
                );

            threadHandle4 = WinApiClass.CreateThread(
                IntPtr.Zero,
                0,
                new WinApiClass.LPTHREAD_START_ROUTINE(IncrementProgressBar),
                (IntPtr)GCHandle.Alloc(3),
                0,
                out threadId3
                );
        }