java thread volatile Àí½â
Java ThreadÓÐÒ»¸ö volatile¹Ø¼ü×Ö£¬Ö÷ÒªÓÃÀ´·ÀÖ¹¶àÏ̷߳ÃÎʹ«¹²±äÁ¿£¬²»Äܼ°Ê±±»ÆäËüÏß³ÌÕýÈ··ÃÎÊ, ¶øÔì³ÉµÄ²»Í¬²½ÎÊÌâ¡£
±ÈÈçThreadA ºÍThreadB ͬʱ·ÃÎÊÒ»¸ö int a = 0; ²¢ÇÒÐ޸ģ¬
¿ÉÄÜ»áÔì³É ThreadA ÐÞ¸Äa±äÁ¿ºó£¬ThreadB·ÃÎÊa±äÁ¿»¹ÊÇÔÀ´µÄÖµ¡£
Òò´ËÒª¼ÓÉÏ volatile int a = 0;
¶àÏß³ÌÆäʵÊÇcpuÄóöÒ»µã×ÊÔ´µ¥¶ÀÈ¥×öÁíÍâһЩÊÂÇ飬Ï̻߳á°ÑһЩ±äÁ¿·Åµ½Ò»¸öС¼Ä´æÆ÷ÖÐ,
ÕâÑù·ÃÎÊÊý¾ÝµÄ£¬²»ÄÜÂíÉϸüÐÂͬ²½µ½ÄÚ´æÖÐÈ¥¡£Òò´Ë¼ÓÉÏvolatile £¬ÈÃËùÓеÄÏ̶߳¼·ÃÎÊͬһ¸öµØ·½£¬ÕâÑùÊý¾Ý¶¼»áͬ²½¡£µ«ÐÔÄÜϽµÁË(MS¶¼Ö±½Ó·ÃÎÊÄÚ´æ)¡£
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
JavaÖУ¬Jniµ÷ÓÃDLLÎļþÊÔÑé
ËùÓÐÎļþ¾ùÔÚE:\·¾¶Ï¡£
°²×°jdk1.6.0_07
°²×°ÁËVC++6.0
µÚÒ»²½£¬
HelloWorld.java
µÚ¶þ²½£¬
E:\>javac HelloWorld.java
µÃµ½
HelloWorld.class
µÚÈý²½£¬
E:\>javah HelloWorld
µÃµ½
HelloWorld.h
µÚËIJ½£¬
±àдһ¸öCÎļþ
HelloWorldImp.c
µÚÎå²½£¬
ʹÓÃcl±àÒ ......
×î½üÔÚÕÒһЩ±ÊÊÔÌ⣬ÒòΪ¿ìÕÒ¹¤×÷ÁË¡£¡£
ÌâÄ¿ÈçÏ£º
ÎÊ´ðÌâ
1.Êý¾ÝÁ¬½Ó³ØµÄ¹¤×÷»úÖÆ
2.Struts±êÇ©ÖÐ<html:errors>µÄ×÷ÓÃÊÇʲô
3.Tomcat<CATALINA_HOME>¸ùĿ¼ÏÂ\server,\common,\sharedÒÔ¼°\WEB-INFϵÄlibÖеÄjarÎļþÔÚʹÓÃʱµÄÇø±ð¡£
Ìî¿ÕÌâ &n ......
125
Ìõ³£¼ûµÄ
java
ÃæÊÔ±ÊÊÔÌâ´ó»ã×Ü
1.
³éÏó£º
¡¡¡¡³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.
¼Ì³Ð£º
¡¡¡¡¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎģР......
1¡¢ http://java.sun.com/ ;;(Ó¢ÎÄ)
SunµÄJavaÍøÕ¾£¬ÊÇÒ»¸öÓ¦¸Ã¾³£È¥¿´µÄµØ·½¡£²»Óöà˵¡£
2¡¢ http://www-900.ibm.com/developerWorks/cn/ ;;
IBMµÄdeveloperWorksÍøÕ¾£¬Ó¢ÓïºÃµÄÖ±½ÓÈ¥Ó¢ÎÄÖ÷Õ¾µã¿´¡£ÕâÀï²»µ«ÊÇÒ»¸ö¼«ºÃµÄÃæÏò¶ÔÏóµÄ·ÖÎöÉè¼ÆÍøÕ¾£¬Ò²ÊÇWeb Services£¬Java£¬Linux¼«ºÃµÄÍøÕ¾¡£Ç¿ÁÒÍƼö£¡£¡£¡
3¡¢ h ......