Jump to content
  • Advertisement
Sign in to follow this  
gorgorath

how to program this in c(++)

This topic is 4401 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have a program that reads in data from a medium, a fast HD in this case, that renders millions of points( streaming ). It is written in java, using NIO byte buffers and opengl vertex buffers. but since i'm new to c(++) how can i achieve fast IO in c(++). tia Paul

Share this post


Link to post
Share on other sites
Advertisement
Just try using standard file IO. You're not going to get hugely faster than that anyway. If you make your program multithreaded, you won't end up blocking on file IO as much - I.e. have a file IO thread and a main render thread.

What OS is this on? There may be mre efficient OS-specific solutions (Like IO Completion Ports on Win32), although like I said - It won't be hugely faster.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
use memory-mapped files

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
use memory-mapped files


any pointers;) to get me started:)

cheers

Paul

Share this post


Link to post
Share on other sites
Gorgorath,

In general, if you're programming on a Windows platform check the MSDN library for documentation on file loading, etc...

I did a quick check, and found this section on reading files using scatter gathering, which is most likely part of the overlapped I/O component of the PlatformSDK, though i'm not sure as I've never worked with it myself.

Cheers and good luck!

Share this post


Link to post
Share on other sites
Quote:
Original post by jwalsh
I did a quick check, and found this section on reading files using scatter gathering, which is most likely part of the overlapped I/O component of the PlatformSDK, though i'm not sure as I've never worked with it myself.


As an aside, the siderbar on the Left also has a link to MapViewOfFile, which can do the memory mapping thing :-).

Share this post


Link to post
Share on other sites
If you search here on the forum a bit, someone recently made a post about achieving some pretty dramatic speed up on I/O. Wish I could remember who it was.

But no matter what you do, keep in mind that I/O *is* slow, and the best way to get good performance is to avoid having to do I/O at performance-critical times in the first place.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!