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ѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
Ôڴ󲿷Ö×ÔѧµÄÇé¿öÏ£¬Ñ§Ï°javaÒÑ¿ìÓÐÒ»ÄêÁË£¬×î½ü¿´ÁËÒ»ÏÂjdkÖÐdemoϵÄClockС³ÌÐò£¬ÔÚÎÂϰÁËÒ»ÏÂAppletµÄͬʱ£¬Ò²Ñ§µ½Á˲»ÉÙж«Î÷¡£Ê×ÏÈ£¬AppletµÄ»ù±¾¹Ç¼ÜÊÇÓÉ£ºinit(),start(),stop(),destroy(),paint(Graphics g),repaint()ºÍupdate()Õ⼸¸ö·½·¨¹¹³ÉµÄ¡£
init()ÓÃÀ´³õʼ»¯ÊµÀý£¬start()ÓÃÀ´Æð¶¯³ÌÐò ......
JAVAÊÇÒ»ÖÖÆ½Ì¨£¬Ò²ÊÇÒ»ÖÖ³ÌÐòÉè¼ÆÓïÑÔ£¬ÈçºÎѧºÃ³ÌÐòÉè¼Æ²»½ö½öÊÊÓÃÓÚJAVA£¬¶ÔC++µÈÆäËû³ÌÐòÉè¼ÆÓïÑÔÒ²Ò»Ñù¹ÜÓá£Óбà³Ì¸ßÊÖÈÏΪ£¬JAVAÒ²ºÃCÒ²ºÃûʲô·Ö±ð£¬ÄÃÀ´¾ÍÓá£ÎªÊ²Ã´ËûÃÇÄÜ´ïµ½Èç´Ë¾³½ç£¿ÎÒÏëÊÇÒòΪ±à³ÌÓïÑÔÖ®¼äÓй²Í¨Ö®´¦£¬Áì»áÁ˱à³ÌµÄ¾«Ë裬×ÔÈ»Äܹ»×öµ½Ò»Í¨°Ùͨ¡£ÈçºÎѧϰ³ÌÐòÉè¼ÆÀíËùµ±È»Ò²ÓÐÐí¶à¹²Í¨µÄµØ·½ ......
1.FileÀàΪ¹ÜÀíÎļþºÍĿ¼ÌṩÁË·½·¨£¬Æä¶ÔÏó±íʾһ¸öÎļþ»òÕßĿ¼¡£ËüÌṩÁËÈô¸É·½·¨¶ÔÎļþ»òÎļþ¼Ð½øÐвÙ×÷¡£ÆäÖеÄlist()·½·¨ºÍlistFiles()·½·¨¿ÉÒÔÆðµ½¶¨Î»Ìض¨ÎļþµÄ×÷Óá£
2.ObjectÀ࣬ÊÇËùÓÐJavaÀàµÄ׿ÏÈ£¬ÈôÒ»¸öÀàÉùÃ÷ʱûÓаüº¬extends¹Ø¼ü×Ö£¬ÔòÆäÖ±½Ó¼Ì³ÐÓÚObjetcÀà¡£ÆäÖÐÓÐÐí¶àÖØÒª·½·¨£º
equals(),not ......
ºÜ¶àÈËÕâÑùÎÊ£¬JAVAÔõôѧѽ£¿Ó¦¸Ã¿´Ê²Ã´Êéѽ£¿
ÀÏʵ˵¸öÈËÀ´Ëµ£¬Êé¿´µÃ²»¶à£¬¿ªÊ¼µÄʱºò¾Í¿´Á˱¾ sam's teach yourself Java2 in 24 hours.
ËùÒÔÎÊÆðÕâЩÎÊÌâ£¬Õæ²»ºÃ˵,ÿ¸öÈ˶¼²»Ò»Ñù.
×ܵÄÀ´Ëµ,ÎÒ¾õµÃÊǶàÁ·Ï°ÊǺÜÖØÒªµÄ,
²»Òª¿´Ì«¶àÊéÒ»±¾¾Í¿ÉÒÔÁË,µ«Á·Ï°Ò»¶¨Òª¶à×ö,
ѧϰÊÇÒ»¸öÄ£·ÂµÄ¹ý³Ì,
Ä£·ÂµÄ¹ý³ÌÖл¹Òª²» ......