Because the Second Life is a 3D display software, it needs to constantly download a large amount of data from the server, such as texture images, different roles use different texture images for different clothing appearances. When these roles are displayed, the texture image downloaded from the server is used. If many characters are displayed, such as 30, these texture images need to be saved to the disk. So how to save it to the disk? A good file system is required to save and read data to the disk. Reading and writing a disk is slow, so you need to use a thread to implement it. Sometimes, reading and writing files does not require timely actions, so that the thread can wait until the CPU is idle.
The LLVFSThread class inherits the LLQueuedThread class, so that LLVFSThread becomes a Message loop processing class. You only need to add requests to the message queue and then implement the message processing function to implement the corresponding functions.
#001 // static
#002 void LLVFSThread: initClass (bool local_is_threaded)
#003 {
#004 llassert (sLocal = NULL );
#005 sLocal = new LLVFSThread (local_is_threaded );
#006}
The above implements the virtual file system Thread class.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.