Re: Re: Question about "fd" token

From: ÀîºêÁÁ (lihongliang070_at_tom.com)
Date: Thu Jun 18 2009 - 22:17:08 PDT

  • Next message: Paul H. Hargrove: "Re: Question about "fd" token"
    Hello, Professor:
    
    How can we ensure information can be dumped only once or per process ?
    
    For example :
    
     the file header about scope & version , we need to write just once.
    
     Resources that are shared among the threads (such as memory mappings and file descriptors) are written out only once, by the first thread. we write it to the file per process.
    
    I see the code in dump_self.c , not the way I supposed to be. 
    
    down(&req->serial_mutex);
    	
     if (!test_and_set_bit(0, &req->done_header)) {
                
          result = cr_save_file_header(req, dest_filp);
                ...
    	}
    	up(&req->serial_mutex);
    
    there are many bool variable in the structure "req" and "proc_req" , like done_header, but every time a thread come to execute the code section above, they can enter and do "cr_save_file_header", for "done_header" is set to "0" again...
    
    By the way, In the early version of BLCR, there is just one structure "req"(instanse of that struct, for convenience). In the later version, "proc_req" is introduced. Once I supposed structure "proc_req" is used to handle something per process. But now it seems not right. Please tell me the main goal of the introducion of "proc_req"?
    
    Thank you very much
    
    
     
    
    

  • Next message: Paul H. Hargrove: "Re: Question about "fd" token"