Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVA NIO ÖÐÎÄ1

 
If the requested address is not a valid virtual memory address (it doesn't belong to any of
the memory segments of the executing process), the page cannot be validated, and
a segmentation fault is generated. This vectors control to another part of the kernel and
usually results in the process being killed.
Èç¹û±»ÇëÇóµÄµØÖ·²»ÊÇÒ»¸öÓÐЧÐéÄâÄÚ´æµØÖ·£¨Ëü²»ÊôÓÚÈκε±Ç°½ø³ÌµÄÄÚ´æ¶ÎÖУ©£¬ÔòÒ³²»Äܱ»È·ÈÏ£¬Ò»¸ö¶Î´íÎó»á±»Éú³É¡£¿ØÖÆ»á±»×ªÒÆµ½Äں˵ıðµÄ²¿·Ö£¬³£³£µ¼Ö½ø³Ì±»É±ËÀ
Once the faulted page has been made valid, the MMU is updated to establish the new virtualto-
physical mapping (and if necessary, break the mapping of the stolen page), and the user
process is allowed to resume. The process causing the page fault will not be aware of any of
this; it all happens transparently.
Ò»µ©Ò³´íÎó±»È·ÈÏÓÐЧ£¬MMU¾Í»á¸üУ¬°ÑеÄÐéÄâ-ÎïÀíÓ³Éä¼ûÁËÆðÀ´£¨Èç¹û±ØÐ룬°Ñ±»ÍµµÄÒ³ÃæµÄÓ³Éäµ·»Ù£©£¬È»ºóÓû§½ø³Ì¾Í±»ÔÊÐí¼ÌÐøÁË¡£µ¼ÖÂÁËÒ³´íÎóµÄ½ø³Ì¶Ô´ËÒ»ÎÞËùÖª£¬¶ÔËü¶øÑÔÕâЩÊÇ͸Ã÷µÄ¡£
This dynamic shuffling of memory pages based on usage is known as demand paging. Some
sophisticated algorithms exist in the kernel to optimize this process and to prevent thrashing, a
pathological condition in which paging demands become so great that nothing else can get
done.
Õâ¸ö¶¯Ì¬»ùÓÚʹÓõÄÄÚ´æ²½·¨±»³Æ×÷°´Ðè·ÖÒ³¡£ÄÚºËÖÐһЩÀϵ½µÄËã·¨»áÓÅ»¯Õâ¸ö¹ý³Ì·ÀֹŹ´ò£¨Ì«±¯²ÒÁË£¬ÏµÍ³³ÌÐòÔ±ÈÕ×Ó°µÎÞÌìÈÕ°¡£©
£¬Ö¸Ò»¸öÎÞ·¨¿ØÖƵÄÇé¿öÏ£¬Ò³ÇëÇó±äµÃÌ«´óÒÔÖÁÓÚ¿¨ËÀÁË¡£
1.4.4 File I/O
File I/O occurs within the context of a filesystem. A filesystem is a very different thing from a
disk. Disks store data in sectors, which are usually 512 bytes each. They are hardware devices
that know nothing about the semantics of files. They simply provide a number of slots where
data can be stored. In this respect, the sectors of a disk are similar to memory pages; all are of
uniform size and are addressable as a large array.
1.4.4 Îļþ I/O
ÎļþI/O·¢ÉúÔÚÎļþϵͳÉÏÏÂÎÄÖС£Ò»¸öÎļþϵͳºÍ´ÅÅÌÊǷdz£²»Ò»ÑùµÄ¶«¶«¡£´ÅÅ̰ÑÊý¾Ý´æÔÚÉ


Ïà¹ØÎĵµ£º

JavaÊý×é×ܽá

תÖÁ£ºhttp://sllereak.blog.163.com/blog
 --javaÀïÃæµÄÊý×é²»ÄÜÕâÑùдint a[5];
 *ÎªÊ²Ã´ÄØ£¿Èç¹ûÕâÑùдµÄ»°Ò»°ãÇé¿öÏ»ὫÎå¸öÄÚ´æ¿Õ¼ä·ÖÅäµ½Õ»ÉÏ£¬µ«ÊÇjavaµÄÊý¾ÝÊÇ·ÅÔÚ¶ÑÉϵģ¬Õ»ÉÏÖ»ÄÜ·ÖÅäÒ»¸öÖ¸ÕëµØÖ·¶øÒÑ
 *Êý×éµÄÉñÃ÷ÓÐÁ½ÖÖ·½Ê½int[] a;»òÕßint a[];
--Êý¾ÝµÄÎÊÌâ
 ·½·¨ÖÐint[] a=new in ......

Java_Ïß³Ì×ܽá

 ×ªÖÁ£ºhttp://sllereak.blog.163.com/blog
--ʲôÊÇÏß³Ì
 *Ïß³ÌÊÇÒ»¸ö³ÌÐòÀïÃæ²»Í¬µÄÖ´Ðз¾¶
 *³ÌÐòÖ´ÐÐÔÚͬһʱ¼äÀïÃæ£¬Ã¿Ò»¸öÖ´ÐеķÖÖ§¾ÍÊÇÒ»¸öÏß³Ì
 *Ò»¸ö³ÌÐòµÄMain()·½·¨ÖеÄÖ´ÐÐÏß·³ÆÎª³ÌÐòµÄÖ÷Ïß³Ì
--½ø³ÌºÍÏß³Ì
 *½ø³ÌÊÇÒ»¸ö¾²Ì¬µÄ¸ÅÄµ±´úÂë±»javaÐéÄâ»ú¼ÓÔØµ½code segmentÖ ......

Java¸ß¼¶Ó¦Óÿª·¢¾­Ñé·ÖÏí

JavaµÄÓŵãÓУº ¿çƽ̨ÐÔºÜÇ¿µÄ£¬Ò»´Î±àÒëµ½´¦ÔËÐУ¬Ò»±ß±àÒëÒ»±ßÖ´ÐУ¬ ²»Êܲ¡¶¾µÄ¸ÉÈÅ¡£µ«ÊÇÃÀÖв»×㣬ÔËÐÐËٶȱÈC£¬C++ µÈÓïÑÔÂý£¬ ·ÃÎÊÓ²¼þµ×²ã±È²»ÉÏC++£¬C£¬Ò»Ð©Ó¦ÓÃÐèÇóÈ´ÐèÒªÖ´Ðд¿ Java ³ÌÐòÎÞ·¨Íê³ÉµÄһЩÈÎÎñ¡£Îª´ËSUN¹«Ë¾ÎªÁËÍ»ÆÆJAVAµÄÆ¿¾±£¬ ¾ÍÒýÈëÁËJNI µÄ×÷Ó㬠JNI¾ÍÊÇÄܹ»¼æÈÝC£¬Ñﳤ±Ü¶Ì£¬ ¿ìËٵķÃÎÊÓ² ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ