IBM Developer is your one-stop location for getting hands-on training and learning in-demand skills on relevant technologies such as generative AI, data science, AI, and open source.
Vï¼ï¼java1.4.2 OSï¼WindowsXp ãã«ãã¹ã¬ããã®ããã°ã©ã ã§ãä¸ã¤ã®ãã¡ã¤ã«ã«ããã¹ãã®åºåãè¡ãã¨ããã§ããã¾ããããªãã¨ãããããã¾ãã ï¼ã½ã¼ã¹ãã¡ã¤ã«ï¼ import java.io.*; import java.util.*; import java.text.*; public class ThreadIppai { public static void main(String[] args) { for (int i = 0; i < 100; i++) { Thread thread = new ThreadHontai(); thread.start(); } } } class ThreadHontai extends Thread { public void run() { try { for (int i = 0; i < 500; i++) {
ä¸ã¤ã®Javaããã°ã©ã ã«ã¤ãã¦ãå¦çããã«ãã¹ã¬ããã§ä¸¦è¡æ§ãæã¤ããã«è¨è¿°ããè¤æ°CPUï¼ãã«ãã³ã¢ï¼ä¸ã§ãã®ããã°ã©ã ãå®è¡ãããã¨ã«ãã並åå¦çãå®ç¾ãããã¨ããéããã°åºåãå®è¡æ§è½ã«ã©ãã ãå½±é¿ãåã¼ãã®ããææ¡ããããã¨èãã¦ãã¾ãã ããã°ã©ã ã®éçºï¼ç¹ã«ãããã°ï¼ã«ããã¦ã¯ããã°ã使ããªãã¨è¦å´ãã¾ãããã ãããã°ãåãè¾¼ãã¨ãæ§è½ã«å½±é¿ãåã¼ãã¾ããã¾ãããã°ã¬ãã«ãæå¶ããå®éã«ã¯ãã°åºåããªãã£ãã¨ãã¦ãããã°ã¬ãã«ã®å¤å®å¦çãåããã¨ã§ãå¤å°ã®å½±é¿ã¯ããã¾ãã æè¿ã®ãã°åºåã©ã¤ãã©ãªã¯ã¹ã¬ããã»ã¼ãã«ä½ããã¦ãã¾ãããããã¯å é¨ã§æä»åºéãæã¤ãã¨ã«ãªãã®ã§ã並åå¦çã«ããã¦ã¯æä»ã«ããæ§è½ã¸ã®å½±é¿ã¯ç¡è¦ã§ãã¾ããã ããã§ãåä¸ããã»ã¹å ã§ãã«ãã¹ã¬ããã«ãã並è¡å®è¡ããããã°ã©ã ãä½æã»å®è¡ããè¤æ°ã¹ã¬ãããããã°ãåºåããã¨ãå®è¡æ§è½ã«ã©ãã ãå½±é¿ãåã¼ã
File lockFile = new File("file.lock"); int retryCount = 30; // timeout = 3sec while (! lockFile.createNewFile()) { if ((retryCount--) == 0) { throw new LockFailedException("give up!"); } Thread.sleep(100); } try { // ãã¡ã¤ã«ããã¯ã§ä¿è·ãããå¦ç ... } finally { lockFile.delete(); } ãã¸ãã¯ãã³ãã¼ã使ã£ã¦ãããå¯ä½ç¨ã®ããå¼ãæ¡ä»¶å¼ã«ä½¿ã£ã¦ãããã¨ã æ°ã«ãªãã¨ããã¯ããããããããç¥ãã¾ãããããã®ã³ã¼ãã®ä¸çªã®åé¡ã¯ "File.createNewFile() ã«é ¼ã£ãããã¯æ©æ§ã«ãªã£ã¦ãã" ãã¨ã§ããã©ããããã¨ãç°¡åã«èª¬æãã¦
ããæ°æ¥ã®ä½è¤å çã®ã¨ã³ããªãç±ãï¼ãErlangãScalaãGoãJavaãªã©ã®ç¾ä»£ã®è¨èªï¼Erlangã¯å¤ããï¼ã«ããã並è¡å¦çã®æ±ãæ¹ã«ã¤ãã¦ãããããã®æ´å²çèæ¯ãæ義ãå¾æä¸å¾æãªã©ãããããããç´¹ä»ããã¦ã¾ãã80年代ãã並è¡å¦çããªãã¸ã§ã¯ãæåãç 究ããã¦ããä½è¤å çãªãã§ã¯ã®è¦ç¹ã§ãããã¡ãã£ã¨é·ããªãã¾ããç¹ã«ç§ãèå³æ·±ãã£ãé¨åãå¼ç¨ãã¾ãï¼å¼·èª¿ã¯ç§ï¼ï¼ ä½è¤ä¸é: Webæ¥è¨ (2010å¹´) æè¿ãèå³æ·±ãã®ã¯ãªãã¸ã§ã¯ãæåè¨èªã®ScalaãErlangã話é¡ãéãã¦ãããã¨ã§ãããããã©ã¡ããActor Modelããã¼ã¹ã«ãã¦ããããã§ããããªãã¸ã§ã¯ãæåè¨èªã®æ´å²ã§ããã¨ãActor Modelãªã©ã®ä¸¦è¡å¦çç¨ãªãã¸ã§ã¯ãæåè¨èªã®ç 究ãçãã«ãªã£ãã®ã¯1985å¹´ããã®6,7å¹´ãããã ã¨æãã¾ã(Actor Modelèªèº«ã¯ãã£ã¨å¤ãã§ãã)ãããã¦19
Java7åºããã Fork/Joinè¦ãã¨ãã«ããExecutors(ThreadPoolExecutor)ã¨FutureTaskã§åºæ¥ãªããï¼ ã£ã¦æã£ãã®ã§ã¡ãã£ã¨å®é¨ãã¦ã¿ãã ãµã³ãã«ã®å®è£ ã®å 容㯠Taskãå¼ã°ããã¨å ¥åãããæ°å¤åæ°åãhogeæååãã¤ãªãã¾ãã åæ°ãå¤ãã¨ãã¯æ°å¤ãååã«ãã¦2ã¤ã®ã¿ã¹ã¯ã«åãã¦ãå®è¡ãã¾ãã 10ãæå®ããã¨hogeã10è¡å表示ããã¾ãã ã¾ãã¯ãä»åã®Fork/Joinãã¼ã¸ã§ã³ã public class HogeForkJoin { static AtomicInteger callCount = new AtomicInteger(); public static void main(String[] args) throws Exception { long start = System.currentTimeMillis
xuwei_kãããé¢ç½ãããªãã¨ï¼scala2.9ã®parallel collection ã® benchmark ããã¦ã¿ãï¼ããã£ã¦ãã®ã§ãã¡ãã£ã¨èªåã§ããã£ã¦ã¿ããã¨ã«ããã æºå ã¾ãã¯Scalaã®ææ°çãåã£ã¦ãã¦ãã«ãããã®è¾ºãåèã«ã ãã¦scalaãèµ·å ãã¨JVMã®å¼æ°ã®Xmx ã 4096M ã«ãã¦ã¾ã ã¨ã®äºãªã®ã§èªåãããã«å£ããXmsãæå®ãã¹ããåãããªãã£ãã®ã§ãæå³ããªã1024ã«ãã¦ã¿ãã4096ã«ãã¨ãã°ããã£ããããããªããã©ã¾ãããã¨ããã ã¡ãªã¿ã«ã¡ã¢ãªã®ãµã¤ãºæå®ã®ä»æ¹ã¯ãããåèã«ã >set "JAVA_OPTS=-Xmx4096M -Xms1024M" >scala Welcome to Scala version 2.10.0.r0-b20110322031631 (Java HotSpot(TM) 64-Bit Server VM,
æ¢åã®ããã°ã©ã ãé«éåã©ãããã°ãããï¼ ãã¨ãã°ãååã®ãªãã¼ã·ã®ã³ã³ãã¥ã¼ã¿ã®å¦çãªã©ãããªè«å¤§ãªè¨ç®éãå¿ è¦ã¨ããããã°ã©ã ãé«éåããææ³ã¨ãã¦ãè¿å¹´ã§ã¯ãã«ãã¹ã¬ããããã°ã©ãã³ã°ãæå¹ã«ãªã£ã¦ãã¦ãã¾ãã ããä½å¹´ãçºå£²ããã¦ããCPUã®å¾åã¨ãã¦ãå¦çè½åã表ãã¯ããã¯å¨æ³¢æ°ã¯3GHzãã伸ã³ã¦ããããCore 2 DuoãQuadãªã©ã®ãã«ãã³ã¢åãé²ãã§ãã¦ãã¾ããï¼ä½è«ã§ãããPS3ã«æè¼ãããã¹ã¼ãã¼ã³ã³ãã¥ã¼ã¿ä¸¦ã®å¦çè½åã¨ãããã¨ã§è©±é¡ã«ãªã£ãCellããã»ããµã¯1PPE + 8SPE = 9ã³ã¢æè¼ããã¦ã¾ã) çç±ã¯ãã¯ããã¯å¨æ³¢æ°ãåä¸ããããã¨ãæè¡çã«éçãè¿ã¥ããçºã§ããã³ã¢æ°ãåã«ããã°ãçè«ä¸å¦çè½åãåã«ãªãã¾ãã ããããã³ã¢æ°ãå¢ããã°æ¢åã®ããã°ã©ã ãé«éã«åä½ããããã«ãªããã¨ããã¨ãããã§ã¯ããã¾ãããæ¢åã®ããã°ã©ã ã®å¤ãã¯ã·ã³ã°ã«
åæ(æ稿æ¥ï¼2011/02/16)ã¸ã®ãªã³ã¯ Akkaã¯ãScalaã§æ¸ãããã©ã¤ãã©ãªã§ãã¢ã¯ã¿ã¼ã¢ãã«ã使ã£ã¦ãèé害æ§ã®ãããé常ã«ã¹ã±ã¼ã©ãã«ãªã¢ããªã±ã¼ã·ã§ã³ãJavaã¨Scalaã§æ¸ããã¨ãç°¡åã«ããã Carl Hewittæ°ã«ãã£ã¦1973å¹´ã«å§ãã¦ææ¡ãããã¢ã¯ã¿ã¼ã¢ãã«ã¯ãErlangã®ãããªè¨èªã«æ¡ç¨ããã¦æåãããé»æ°éä¿¡æ¥ä¼ã§ã¯ãé常ã«é«å¯ç¨æ§ã®ãããé常ã«ã¹ã±ã¼ã©ãã«ãªã·ã¹ãã ãæ®éã§ããã Scalaè¨èªã®çã¿ã®è¦ªã§ãã Martin Oderskyæ°ãè¨ãã«ã¯ã Akkaã¢ã¯ã¿ã¼ã¯ã欲ããç©ãããããåãã¦ãããé常ã«ã¹ã±ã¼ã©ãã«ãé«ããã©ã¼ãã³ã¹ã§ãåæ£ã·ã¹ãã ã§é常ã«è¯ãæ©è½ããã ããã¸ã§ã¯ã ãªã¼ãã® Jonas Boneræ°ãä»æ¥ãAkkaã¯ã1.0ãã¤ã«ã¹ãã¼ã³ã«å°éãããã¨ã¢ãã¦ã³ã¹ãããInfoQã¯ãæ°ã«ããã¸ã§ã¯ãã«ã¤ãã¦ãã詳ããèãã
Spring Bootã«ããAPIããã¯ã¨ã³ãæ§ç¯å®è·µã¬ã¤ã 第2ç ä½å人ãã®éçºè ããInfoQã®ããããã¯ãPractical Guide to Building an API Back End with Spring BootããããSpring Bootã使ã£ãREST APIæ§ç¯ã®åºç¤ãå¦ãã ããã®æ¬ã§ã¯ãåºçæã«æ°ãããªãªã¼ã¹ããããã¼ã¸ã§ã³ã§ãã Spring Boot 2 ã使ç¨ãã¦ãããããããSpring Boot3ãæè¿ãªãªã¼ã¹ãããéè¦ãªå¤...
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}