Texture pictures for the 3D program is more important data, if there is no texture pictures, there is no bright appearance, there is no rich and colorful world. In the second life, texture pictures are not released with the program, but are constantly downloaded from the server, this is not like other games, all the pictures in advance to download all the good. Here is an analysis of the texture download thread's working process. First from the program: Llappviewer::gettexturefetch ()->createrequest (GetID (), Gettargethost (), Decode_priority, W, H, C, desired_ Discard, Needsaux ()) calls the Createrequest function to create a texture picture download. Then the Lltexturefetch::update function is called in the texture download thread to update the request, and the texture thread lltexturefetch is started to get the texture picture. The thread class Lltexturefetch is inherited from the Llworkerthread thread class, so it is also called a worker thread to run. If you download a texture picture from the network, how to execute it. First look at the following code: #001 void lltexturefetch::addtonetworkqueue (lltexturefetchworker* worker) #002 {#003 if (Mrequestmap.find (worker->mid)!= mrequestmap.end ()) #004 {#005 //Only add to the queue if in the Request Map #006 //i.e. a delete has not been r equested #007 Mnetworkqueue.insert (Worker->mid); #008 } #009 for (cancel_queue_t::iterator iter1 = Mcancelqueue.begin (); #010 iter1!= mcancelqueue.end (); ++iter1) #011 {#012 iter1->second.erase (Worker->mid); #013 } #014  } The code above is to add this texture picture to the network download queue mnetworkqueue, and then send a request for the download picture to the server from the network layer. #001 s32 lltexturefetch::update (U32 max_time_ms) #002 {#003 S32 Res; 004 res = llworkerthread::update (Max_time_ms); #005 #006 const F32 request_time = 1.F; #007 #008 //Periodically, gather the "list of textures" need data from the Networ K#009 //and send the requests out to the simulators #010 if (Mnetworktimer.getelapsedtimef32 () >= request_time) #011 {#012 & nbsp; Mnetworktimer.reset (); #013 sendrequestlisttosimulators (); #014 } #015 #016 return Res #017  } The above code is to continuously send the ID to the network request to download the texture to the server, mainly through the function sendrequestlisttosimulators to implement, the function of the code is longer, the next time to analyze it.