Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello, I got an amazing high-speed serial transition board. It has 4-ports independently, each of the ports could get 50Mbps transition rate. I installed it into my PC via PCI-e interface.
Basic circumstances, PC's CPU is i7, so I think the performance meet the requirement. I works with MFC at Visual Studio 2005.

The problem is that the current receiving speed is only 5 Mbps. However, the requirement is at least 10 Mbps. I want some advice about how to improve my receiving speed.

There is my current solution. First of all, I closed-loop two ports. Then I created two threads SendThread and RecvThread. I used the function SetThreadAffinityMask() put two threads to two CPU. and both of them run it fine. The high-speed company provide driver. there are function write(buffer,size) read(buffer,size).
there is my pseudocode.
C++
SendThread()
{
    initial();
    while(true)
    { 
        if(GetContext(buffer))
        Port1.send(buffer,size);
        SendCounter++;
    }
}
RecvThread()
{
   initial();
   while(true)
  { 
      if(Port2.receive(buffer,size))
      LoadContext(buffer);
      RecvCounter++;
   }
}

The stability parameters ie clock frequency is 15 MHz, the send frame size is 3000 bytes, the receive frame size is 3000 bytes. The stability mean there are no help for improve receiving rate when the clock frequency or frame size increased. But if increase the clock frequency, the send rate would have a increasing. PS: The GetContext() and LoadContext() are OK.
Today, I have some tests each of them last for 1 min. When the send frame size is 3079 and the receive frame size is 6158, the send times is 143325 and the received times is 12247. When the send frame and receive frame’s size is 3079, the send times is 131156 and the received times is 21570. The final received data stored is equal to receive frame size * received times. By comparing data, I don’t found the phenomenon of frame lost. Through lots of tests I found the maximum received rate is limited 5 Mbps, and the rate is too slow to meet demand. Meanwhile I never seen the frame lost, it is the biggest puzzle to me.

I have this problem lasts for two weeks, and the deadline is coming. Could you give me some advice? Thank you very mush!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900