Home > Net >  Hard drive speed will affect the rate of multithreading concurrent execution?
Hard drive speed will affect the rate of multithreading concurrent execution?

Time:10-05

Description and questions as follows:
1. The thread after startTrd in s1 s2 for two concurrent threads of execution, after the two threads are executed, the do somethings, then concurrent both threads, exit the loop until after the condition is met,
2. The phenomenon for this program and my laptop (and only the SSD) configuration about desktop computer (no SSD) running, running speed, for example, with the operation conditions, to run on my laptop to collect 300 points, only 100 or so on desktop,
3. In the process of collecting, hard drives will flash once in a while, guess is there. The.net environment thread is in the dynamic data read from the hard disk, thus caused the two computer configuration similar efficiency difference,
4. The.net mechanism is not very good, is there this kind of program (no hard disk IO operations) during execution will have the possibility of loading; Or Windows system is this: there will always be read threads exist, from time to time to read the hard disk operation,
5. If it is the influence of SSD, can run the program all the necessary code (including library code) all read into memory to avoid the program runs during loading?





 
Private OriDat dynData;
Private bool ifEnd=false;
Private MeasureResult MeasureResult=new MeasureResult ();
Private void startBtn_Click (object sender, EventArgs e)
{
StartThread=new Thread (startTrd);
StartThread. Start (new startCallBackDelegat (startTrdCallBack));
}
Private void startTrd (object o)
{
List OriDats=new List (a);
Motor. The start (" 500 ");
MotorDelegate mDelegate=new motorDelegate (s2);
LaserDelegate lDelegate=new laserDelegate (s1);
IfEnd=false;
Do
{
DynData=https://bbs.csdn.net/topics/new OriDat ();
IAsyncResult m=mDelegate. The BeginInvoke (new AsyncCallback (s2Complete), mDelegate);
IAsyncResult l=lDelegate. The BeginInvoke (new AsyncCallback (s1Complete), lDelegate);
M. syncWaitHandle. WaitOne ();
L.A. syncWaitHandle. WaitOne ();
String pos=the string. Format (" {0: F4} ", dynData pos/10 m);
OriDats. Add (dynData);
This. Invoke (new EventHandler (delegate {textBox5. Text=dynData. Diameter [0]. TextBox6. Text=pos; }));
} while (! Motor. IfStop2p & amp; & ! IfEnd);
MeasureResult. OriDats=oriDats;
As startCallBackDelegat startCallBackDelegat callBack="o.
The callBack ();
}
Private void s1Complete (IAsyncResult iar)
{
Thread. The CurrentThread. Priority=ThreadPriority. The Highest;
String [] ss=new string [2].
LaserDelegate task=(laserDelegate) iar. AsyncState;
Ss=task. EndInvoke (iar);
If (ss [0]=="999.9999" & amp; & Ss [1]=="999.9999")
{
Motor. The disable ();
IfEnd=true;
return;
}
DynData. Diameter [0]=the string. Format (" {0: F4} ", d1);
DynData. Diameter [1]=the string. Format (" {0: F4} ", d2);
}
Private void s2Complete (IAsyncResult iar)
{
Thread. The CurrentThread. Priority=ThreadPriority. The Highest;
MotorDelegate task=(motorDelegate) iar. AsyncState;
DynData. Pos=task. EndInvoke (iar);
}
Private string [] (s1)
{
Thread. The CurrentThread. Priority=ThreadPriority. The Highest;
The return laser. The getValue ();
}
Private decimal s2 ()
{
Thread. The CurrentThread. Priority=ThreadPriority. The Highest;
Return motor. The pos ();
}

CodePudding user response:

Will, disk I/o is fixed, such as 7200 turn 10000 turn, general program is hard to exceed the throughput, if you really can use SSD is not assured

CodePudding user response:

reference 1st floor HyoJung response:
, disk I/o is usually fixed, such as 7200 turn 10000 turn, general program is hard to exceed the throughput, if you really can not be at ease use SSD


I have already booked on SSD, the emergence of the problem is really let me think a lot:
1. According to the understanding of before, after system boot and stable as long as no users interact with the system, there is no automatic task, the system does not have hard disk IO, but the actual is some, so the SSD is not only to the promotion of the Windows boot, the boot after the promotion has been around and sustained,
2. The device actually should I use MCU + RAM to realize the real-time processing and buffer, indeed as expected is, each have each good at field open longer Rolls-Royce in hutong buy vegetables is a joke,
3. I also want to ask, to arm architecture, such as QT or Android class Linux system also exist this kind of problem?

CodePudding user response:

The same ah, as long as there is programs run on the hard disk read and write, the operating system is nothing more than a large program,

CodePudding user response:

The main test drive random, speaking, reading and writing, rather than order, speaking, reading and writing, SSD random IO speed of mechanical disk blocks, this has to do with the. Net has nothing to do, but is related to hardware and operating system, now operating systems are becoming more complex, the background tasks more and more, even if you don't operate it, also will not regularly to access the hard disk, check the network, for example, free time herbs, writing log, download patches, etc.,

CodePudding user response:

reference 4 floor datafansbj response:
the main test drive random, speaking, reading and writing, rather than order, speaking, reading and writing, SSD random IO speed of mechanical disk blocks, this has to do with the. Net has nothing to do, but is related to hardware and operating system, now operating systems are becoming more complex, the background tasks more and more, even if you don't operate it, also will not regularly to access the hard disk, check the network, for example, free time herbs, writing log, download patches, etc.,

It seems I met the problem was caused by the operating system, thank you to give directions

CodePudding user response:

Don't you ever wonder, your system under the bottom of a pagefile. Sys large files (if you didn't change the default path)

This is a virtual memory page file, a process can allocate memory nG, then ran so many Windows process, add up you have how old? Not enough physical memory, so he will put some things in the virtual memory, virtual memory, of course, is to use hard disk virtual

So, your program estimates of memory footprint is higher

Ps: exchange system and a program file swapfile. Sys that's file and virtual memory with

Hard drive big ah, ah, you estimate never "red", I system disk floating red for a long time, so the partition time consider those things can be deleted, in fact, every time want to put the two things to set it to other places (too big), but because it is a system disk is SSD, moved to the other tray efficiency is not so high, so they still stay in the system tray

CodePudding user response:

refer to 6th floor wanghui0380 response:
don't you ever wonder, your system under the bottom of a pagefile. Sys large files (if you didn't change the default path)

This is a virtual memory page file, a process can allocate memory nG, then ran so many Windows process, add up you have how old? Not enough physical memory, so he will put some things in the virtual memory, virtual memory, of course, is to use hard disk virtual

So, your program estimates of memory footprint is higher

Ps: exchange system and a program file swapfile. Sys that's file and virtual memory with

Hard drive big ah, ah, you estimate never "red", I system disk floating red for a long time, so the partition time consider those things can be deleted, in fact, every time want to put the two things to set it to other places (too big), but because it is a system disk is SSD, moved to the other tray efficiency is not so high, so I still stay in the system tray

Virtual memory would have turned off ah,

CodePudding user response:

nullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • C #
  • Related