Re: Background loading thread

Jon Watte <[email protected]> Fri, 08 Sep 2006 16:16:33 -0700
Newsgroups gmane.games.devel.windows
Message-ID <[email protected]>

Ivan-Assen Ivanov wrote:
> I hope Windows has the common sense to switch away from a thread which
> is performing a lengthy synchronuous IO operation?

Yes, it does.

The main gain in overlapped I/O is that the amount of device 
parallelism, and the degree of completion parallelism, can be separated. 
With ReadFile() in threads, you need to create as many threads as you 
want to have simultaneous disk loads outstanding; with IOCP, you only 
need to create as many threads as you want simultaneous completions. The 
typical number for a hard disk is 4 or 5 for the former, but only one 
for the latter (unless you have a massively parallel I/O subsystem, 
which means you're not doing a typical game asset load thing anymore).

If you can pay the cost of the thread safety, and the stacks of the 
threads, then you can go with some number of threads for your I/O needs. 
Just don't call CreateThread() for each I/O operation...

Cheers,

          / h+


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=555