C++ :: Why Windows Multi-threading Data Fetch IOPS Too Fast

Feb 10, 2012

I have a SSD and I am trying to use it to simulate my program I/O performance, however, IOPS calculated from my program is much much faster than IOMeter.

My SSD is PLEXTOR PX-128M3S, by IOMeter, its max 512B random read IOPS is around 94k (queue depth is 32). However my program (32 windows threads) can reach around 500k 512B IOPS, around 5 times of IOMeter!!! I did data validation but didn't find any error in data fetching. It's because my data fetching in order?

I paste my code belwo (it mainly fetch 512B from file and release it; I did use 4bytes (an int) to validate program logic and didn't find problem).

#include <stdio.h>
#include <Windows.h>
/*
** Purpose: Verify file random read IOPS in comparison with IOMeter
**/

//Global variables
long completeIOs = 0;
long completeBytes = 0;
int threadCount = 32;
unsigned long long length = 1073741824; //4G test file

[Code] ....

View 1 Replies


ADVERTISEMENT

C# :: Windows Form Application Using Visual Studio To Fetch Data From Web?

Aug 19, 2014

I want to write my own application which would fetch some data from a web site. I need to parse the HTML code of the web site and get the data.

About the application:A form (main form) that will contain data arranged in rows. Some of the data comes from a web site and some of it comes from a database.The data that comes from the web site needs to be updated every few seconds so I need to keep fetching the data from the web site.The main form will contain a button "add" which when clicked will add a new row. New data can be added to this row by the user.

I am not sure what to use for this. I have been writing the application as a Windows Form Application (Visual C#) but I do not know whether this is the best choice. Should it be a windows form application or web application? Should I use something else?

View 6 Replies View Related

C++ :: Recursive Directory Scan - Can Use Multi-threading For Speed?

May 11, 2014

In our Qt application, we have to load several files on application start-up starting from a root directory.

We are recursively scanning the directories and loading the files.

The total time it takes is about 12 seconds. Can we reduce this time if we use multi-threading?

I have heard that multi-threading does not work everywhere and it increases code complexity and debugging issues.

Would multi-threading solve the above problem? We want it to be platform independent (Mac, Linux, Windows).

View 9 Replies View Related

C++ :: Generate Random Data (fast)

Feb 20, 2013

I just want to know how fast can C++ generate data? For example, I have a downstream device that is connected to my pc via a Gigabit Ethernet, and I have to generate some pattern and send it over the Gigabit interface.

I was curious if there is a way that I can see how fast I can generate data? I was curious if I can exercise a good portion of the bandwidth ! for example, sending about 600 Mbits/sec.

How do I find out, first, whether I can do this with C/C++, and, second, how do I know how fast I am sending data?

View 4 Replies View Related

C# :: T-SQL Multi Table Union To Call Out Data

Jul 15, 2014

I'm trying to union eleven tables to call out data. Parent table is 'Events', child tables are 'SR1Laptimes', 'SR2Laptimes' and so on (there are ten SR... tables). Primary key in all tables is EventName. Parent/Child relationship is Events.EventName/SR1Laptimes.EventName etc All tables that start with SR have the same Schema. I'm trying to call out MIN(Q1) across all table but first need to Union them I believe. Here is my code.

myCommand.CommandText = "SELECT MIN(Q1), MIN(Q2), MIN(Q3), MIN(Q4), MIN(LaptimesMinutes), MIN(LaptimesSeconds) FROM (SELECT * FROM Events UNION ALL SELECT * FROM SR1Laptimes UNION ALL SELECT * FROM SR2Laptimes) WHERE (Events.Track = @track) AND (Events.Number = @number) AND (Events.Rider = @rider)";
myCommand.Parameters.AddWithValue("@track", analysisTrackComboBox.Text);
myCommand.Parameters.AddWithValue("@number", analysisNumberComboBox.Text);
myCommand.Parameters.AddWithValue("@rider", analysisRiderComboBox.Text);

View 4 Replies View Related

C++ :: Multi Data Types In A Line And Read To Struct?

Aug 14, 2014

How can I read this file in to my struct?

12345Joe Lim KH879.00
12233Kay Suet Yee35.98
23781Leong Jing Yang 10.00
67543Woon Tian Yi500.50
struct master {
unsigned short int IDnum;

[code]....

not working

View 16 Replies View Related

C++ :: SDL Object Moves Too Fast

Jan 2, 2013

I am currently making pong using visual C++ with the SDL libary. I find that the ball moves too fast for the players and needs to slow down. The code for the movement is in a while loop and vairies speeds 1 - 2 (X and Y).

CODE:

//ball movement{
ballX += speedX;
ballY += speedY;
//}

ballX and ballY is the position of the ball.
speedX and speedY are the speeds. these change from 1 - 2

How to make the ball move less than one pixel or something along those lines.

View 8 Replies View Related

C++ :: Huge Vector - Find Item Fast

Dec 31, 2012

I want to build a server which holds hundreds of thousands of active users in memory. To keep all the users organized i would like to store them in a Vector.

The problem is how i could quickly and easy find the object whenever i need it? All users will have a unique ID. Would it be possible to keep some form of a Vector Index on the unique id number?

View 2 Replies View Related

Visual C++ :: Stream Data From System Windows Controls

Dec 19, 2012

I need make a CBitmap or a streamdata from a System.Windows.Controls::Image(rendered out put)in a SDI mfc application (supporting clr). Here is my codes:

Code:
using namespace System;
using namespace System::IO;
using namespace System::Collections::Generic;
using namespace System::Windows;
using namespace System::Windows::Controls;

[Code] .....

By this codes i can read datastream from bitmapSource but in this way somthing goes wrong in most of GIF animations. After debug i found out i need 3 more things too decode a gif animation - (x,y) position and size of each frame and disposal method for each one - finally i just found a way to draw tru images on a form window by this codes:

Code:
System::Windows::Window^ mainWindow;
mainWindow = gcnew System::Windows::Window();
mainWindow->Title = "GIF Imaging Sample";
//ScrollViewer^ mySV = gcnew ScrollViewer();
array<System::Byte>^ pixels = gcnew array<System::Byte>(bitmapSource->PixelHeight * Stride);

[Code] ...

When i change

Code: bitmapSource = decoder->Frames[0];
to
Code: bitmapSource = decoder->Frames[01];

frame[1] has drawn perfectly on window(i think some how Image class takes care about - (x,y) position and size of each frame and disposal method for each one ),so im wonder if how can i make a CBitmap or a data stream from System.Windows.Controls::Image class to use in mfc app.

View 2 Replies View Related

C :: Threading With OpenMP

Apr 10, 2013

I wrote code that finds the number of prime numbers in a range entered by the user. Now I'm attempting to make it run in parallel with the number of threads I assign it to have. I'm using blocking technique, so I'm assigning, in this scenario, 4 threads - 1/4 of the numbers in the range to the first array, and the next 1/4 of the numbers in the range to the next array and so on. Then I want to execute the prime number counting code in parallel. I'm using openMP to do this. I'm having difficulty setting it all up properly. I have a little experience with pthreads but little with openMP and am struggling in how this should be done.

Code:

#include <stdio.h>
#include <stdlib.h>
#include <omp.h>

[Code]....

View 2 Replies View Related

C :: Verified Code For Computing Fast Furrier Transform Of Image

Jun 9, 2013

i am looking for a verified code in simple c, for generating fft of an input image (.jpg). the output can be a text file including fft coefficients.can you recommend me any source except open-cv?

View 6 Replies View Related

C++ :: Column Based Database - Constructing Very Fast Radix Sort

Apr 12, 2014

I'm attempting to build a column based database, and I'm new to C++ (just wanted to play around with building a column base database "for the fun of it"). I want to construct a very fast radix sort, that would allow me to quickly sort groups of columns based on integer values. My general preference is to take up more RAM to get more performance.

I'd like to build the radix sort by allowing 256 "buckets" to drop values in as I'm sorting. This allows me to sort through a group of 4 byte integers in only 4 passes. But assuming I'm trying to sort a large group of values (say 50+ million), I'm not sure what type of container to use for these. Also note I'm pretty unfamiliar with the "standard library", so below are my thoughts:

Vectors:
-Pros: Easy to use, and very fast for sequential and random access inserts / reads
-Cons: If they have to dynamically resize because a given vector wasn't large enough, this can apparently really slow performance. Unless I make another pass over the numbers before I start sorting, I wouldn't know how big to make individual the individual vectors. This means I either have to make them "too big" and waste space, or pay a performance price for either resizing, or scanning data first.

Lists:
-Pros: Seems like I wouldn't have to specify size ahead of time, so I could just easily insert values to a given list. Also, since I don't need random access reads (I'll ready the "0" list sequentially, then the "1" list, etc. they should work fine.
-Cons: I don't really know much about lists, but I'm not sure how easy it is to append a new value to the end of a list. I've read that standard library lists include both "forward" and "backward" pointers, which I don't need. Also, I find it hard to believe that there isn't some time taken up with memory allocation. If I build a list and append x million records in it, is it calling memory allocation routines x million times?

Or maybe there's another container type I should learn?

Again, my goal is to make this "fast", not "memory efficient". But having said that, the fastest way I could think of (use 256 vectors, each sized equal to the total number of members to be sorted) is just too much memory to burn - 256 times a vector big enough to hold millions of elements is too much.

View 4 Replies View Related

C++ :: Threading Over The Network With Pthread Or TBB?

Jun 13, 2013

I'm wondering if there is a library for C++ that supports threading over the network, maybe with a threading pool and a specific protocol; or if there is just a de-facto protocol for doing threading over the network.

View 10 Replies View Related

C# :: How To Fetch Particular Text From A String

Jan 15, 2015

I have a string (zoneId==176)&&((startTime==100)&&(endTime==1200)) from which i want to fetch value of startTime and endTime in C#.

View 7 Replies View Related

C/C++ :: Threading - How To Pass By Reference

May 13, 2014

I've written some code that I am currently threading but I am unsure how to pass by reference, or rather why my pass by reference is failing.

I am passing an array of floats by reference, this works fine when not threaded but I am given the error that float*&field does not match std::reference_wrapper<float*>.

Anyways. Here's the code.

The method:

diffuse(int b, float*& field, float*& pField, float diffFactor, float dt, int iteration)

The thread:

std::thread diffuseThread(diffuse, 1, std::ref(u), std::ref(prevU), visc, dt, iteration);

View 14 Replies View Related

C/C++ :: Threading / How To Invoke It Properly

Jun 12, 2012

I'm using MS' optimizing compiler CL 13.10 (one from VCToolkit 2003) along with WinAPI threading functions and is being compiled as a C console program.

I was wondering how to implement threading in a production setting? I've seen and tried various examples, but they all show basically the same thing - startup in main, run their function, clean up, and then the program exits.

I don't know the proper terminology, but I was looking for two maybe three functions to run simultaneously with a loop in main. I tried a small test program and was wondering if it's setup correctly.

A structure is used as the argument for each function.

int running = 1; // global variable  
DWORD WINAPI function_1(LPVOID);
DWORD WINAPI function_2(LPVOID);   
main() {  
   HANDLE hndThreads[2];
   DWORD threadIDs[2];

[code].....

Right now, function_2 is just a copy of function_1's definition. Everything *appears* to do what I want, but is it setup correctly?

View 2 Replies View Related

C/C++ :: Threading In Classes Instead Of Main?

Nov 1, 2013

I want to make a thread outside an int main() method; and this code below gives an error of (paraphrasing) 'no constructor found for thread for type void()'

#include <thread>;
class Board(){  
//Lines Later  

[Code]....

Is there any way to accomplish threading outside the main and in a class?

View 1 Replies View Related

C# :: Fetch Log File From Fingerprint Reader?

Jan 24, 2014

I am Using a fingerprint Scanner for attendance posting.

finger print reader vendor is essl,model is[URL] The device is connected on lan,It has option to download the users list and attendance list to pendrive in .dat format.

I am looking for fetching these data from device through any of the network computers other than manually copying to pendrive from the device each time.

Is it possible to download data from device through any of the network machines Using C# code ?

View 7 Replies View Related

C# :: Fetch Column Value From Datatable To Compare

Dec 16, 2014

I am getting a excel sheet in datatable with some column "Program,Response,T,Timein".There is 3 condition for filtering datatable.

1.fetch unique program.so i got dis.
2.T not equal to "B". I also got dis.
3.Response should be > 5000. I also got dis data in datatable.

Now in Datatable I have same program name presented 3 times with response>5000 nd T<>B.Now I want to fetch only the maximum respnse among 3 of them. so every time my program should be change and for that program I need to pickup max response so How can I do this? for the same I put two loops

for (int i = 0; i < DataFilter.Rows.Count; i++) {
DataRow dr = DataFilter.Rows[i];
DataView dv2 = new DataView();

[Code]....

View 1 Replies View Related

C Sharp :: Pulling Data From Database In Windows Form To Make It Interactive And Pushing It?

Jul 6, 2012

I am busy with a project, it is going to consist out of 3 different windows which is logic enough for this whole code to be interactive.

It must be able to pull data into a windows form, displaying it into a textbox, and when you click on the textbox it needs to open up another window where you will have a windows form that will display data as the code loops through the questions in the database.

I am not sure how to push the data that has been selected on the database to the next window..

Here is my code for the first window:

;
namespace WindowsFormsApplication1
{    
    public partial class Form1 : Form  {
        //SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=KnowledgeEssentials;Integrated Security=SSPI");
        //int intType = 0;
        public Form1()

[code].....

With the second window the data in the table needs to be displayed and each row from the table needs to have a checkbox next to them, so that if the check box is checked, the relevant information of the checked row will show up in the 3rd window... so MY question is, HOW do I pull that data from that specific database and let it show in the listcheckbox?

View 1 Replies View Related

Visual C++ :: Serial Communication In Windows - ClearCommError Finds No Data In Read Buffer

Dec 13, 2013

I want to send data from a laptop (windows 7, processor 2.60GHz) to a desktop (windows xp, processor 3.10GHz) using serial communication (using a USB to RS232 convertor). The WriteFile function is able to send the data from the laptop (NumberOfBytesWritten is correct). But on the desktop side, ClearCommError detects no data in the read buffer.

This is the relevant code in my desktop:

while(1) {
ClearCommError(hPort,&dwErrors,&commStatus);
if (commStatus.cbInQue != 0) ReadFile(hPort,&data,1,&dwBytesRead,NULL);
Sleep(10);
}

The if condition is never satisfied. The baudrate and other parameters in the DCB struct are the same on both sides.

The same code works when I write and read in the same system by shorting the RX and TX pins in the RS232 connector.

View 2 Replies View Related

C# :: Fetch Datatable Values To Perform Some Operation

Dec 16, 2014

I am having some column say "Response" column in my Datatable.Now I want to fetch this particular column value and compare this value with the maximum response how to fetch and compare it in C#.net .. This is my code.

for (int i = 0; i < DataFilter.Rows.Count; i++) {
DataRow dr = DataFilter.Rows[i];
DataView dv2 = new DataView();
dv2 = DataFilter.DefaultView;

[Code] ......

View 3 Replies View Related

C Sharp :: Fetch Huge Files From The Webserver

Jun 14, 2012

i have a spec for fetch the files from server and predict the un-used files from the directory in this situation i am going to fetch the files from server it will return huge files, the problem is the cpu usage will increase while i am fetching large files, so i like to eliminate this scenario.

View 1 Replies View Related

C Sharp :: How To Fetch All Rows Inserted In Datagridview

Sep 14, 2014

I fetch maxid row to view in datagridview using the following code :

 public static DataTable GetMaximpID() {
            string strconn = AlShehabi.Properties.Settings.Default.NewSalariesDBConnectionString;
            SqlConnection conn = new SqlConnection(strconn);  
            if (conn.State == ConnectionState.Closed)

[Code] ....

But I want to fetch all rows inserted and view in datagridview.... For example if user insert 4 rows I want to view them in datagridview after insert them using insertbutton_click....

View 2 Replies View Related

C++ :: How To Make Blocking Fetch Call On Queue

Mar 5, 2015

I have a thread that fetch elements from a std:queue, which are pushed from other threads. My question is how can I fetch elements from the queue in a blocking mode, what I mean is if there are no elements in the queue then the fetch call will block until at least one element is pushed. Of course I want to do it this way to avoid polling.

View 6 Replies View Related

C :: Read Text File From Memory Card Using Threading

Mar 25, 2013

I need do read a text file from memory card using threading.

I am able to do it with out using thread but because of some limitations, i have to do it with threading only.

Here is the code to read file from memory card with out thread:

Code: ##########################################
#include <stdio.h>
#include <stdlib.h>
#include <XMC4500.h> /* SFR declarations of the selected device */
#include <DAVE3.h> /* Declarations from DAVE3 Code
#include <stdio.h>
#include <string.h>
#include <stdbool.h>

[Code]...

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved