sleep sort ã¨ãç°å¢ã«ãããããã¦21ä¸ç´ã«ã¯ä¸åãã ã¨æãã®ããªã®ã§ nicesort ãªããã®ãä½ã£ã¦ã¿ãã #! /bin/bash function f() { nice -n "$1" perl -we 'for (1..1000000) {}' echo "$1" } while [ -n "$1" ] ; do f "$1" & shift done wait ãããªæãã§åãã¾ãã注æç¹ã¨ãã¦ã¯ããã«ãã³ã¢ã ã¨ãã¾ãåããªãã®ã§ taskset 使ãã¾ããã (linux ã®å ´å) ã£ã¦ã®ã¨ã0-20ã®ç¯å²ã§ãããã¼ã¨ã§ããªããã£ã¦ãããããã. $ taskset 1 ./nicesort.sh 1 9 6 4 1 4 6 9ã¡ãªã¿ã«ãnice å¤ãï¼å¢ããã¨å®è¡æéã¯1.25åã«ãªããããã¯è©¦é¨ã«åºããï¼ åè: é©å½ã®æ¥ã ï¼ CFSã®niceå¤ã«ã¤ãã¦
{{#tags}}- {{label}}
{{/tags}}