Changes

Jump to navigation Jump to search
1,089 bytes added ,  09:06, 25 April 2017
no edit summary
Line 1: Line 1:  
= Masters and slaves =
 
= Masters and slaves =
 
# A file may be referred by several file descriptors. The descriptors may belong to a single process or to several processes.
 
# A file may be referred by several file descriptors. The descriptors may belong to a single process or to several processes.
# Group of descriptors referring to the same file is called shared. One of them called master, others are slaves.
+
# Group of descriptors referring to the same file is called shared. One of the descriptors is named master, others are slaves.
# Every descriptor is discribed via struct fdinfo_list_entry.
+
# Every descriptor is discribed via struct fdinfo_list_entry (fle).
# Shared file descriptors are distributed between tasks using scm_rights. See send_fds() and receive_fds() for the details.
+
# One process opens a master fle of a file, while other processes, sharing the file, obtain it using scm_rights. See send_fds() and receive_fds() for the details.
    
= Per-process files restore =
 
= Per-process files restore =
Line 19: Line 19:     
Note: it's also possible to go to step "2" right after new_fd is written.
 
Note: it's also possible to go to step "2" right after new_fd is written.
 +
 +
= Notes =
 +
# Pipes (and fifos), unix sockets and TTYs generate two fds in their ->open callbacls, the 2nd one can conflict with some other fd the task restores and (!) this "2nd one" may require sending to some other task. This imposes another requirement on the 3-stages engine described above.                                                                                 
 +
# Some actions can only be done only after file is created, served out    and moved to proper position. E.g. epoll configuration and scheduling    TCP repair off. Thus the ->post_open call :( and separate queue for  epoll fds.                                                                                                                                               
 +
# Slave TTYs can only be restored after respective master peers. Take into account the issue #2, this results in 3rd queue for slave TTYs.
 +
# CTTYs should be __created__ after all other TTYs are created, configured and served out. Thus separate stages (not only queue) for CTTYs.
    
[[Category:Under the hood]]
 
[[Category:Under the hood]]
 
[[Category:Files]]
 
[[Category:Files]]
17

edits

Navigation menu