changeset 15:7c64665b26bf

backup 2021-01-04
author autobackup
date Mon, 04 Jan 2021 00:10:03 +0900
parents 9404c0e15e39
children a6fe06ec0cf9
files Christie/for.NET.md Christie/for.NET/優先度つきThreadPool.md user/anatofuz/note/2021/01/03.md
diffstat 3 files changed, 55 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Christie/for.NET.md	Sun Jan 03 00:10:04 2021 +0900
+++ b/Christie/for.NET.md	Mon Jan 04 00:10:03 2021 +0900
@@ -29,7 +29,7 @@
 java TreeMap<> → C# SortedDictionary<>  
 java HashMap<> → C# Dictionary<>  
 java Class clazz → C# Type clazz  
-java LinkedBlockingQueue<> → C# ConcurrentQueue<>  
+java LinkedBlockingQueue<> → C# ~~ConcurrentQueue<>~~  → BlockingCollection<>  
 java socket.getInetAddress().getHostName() → C# Dns.GetHostEntry(((IPEndPoint) socket.RemoteEndPoint).Address.ToString()).HostName  
 java clazz.getName() → C# `type.Name`
 java socket.getInputStream().read() → C# socket.Receive([格納する配列]) (intの長さが返る) 
@@ -161,7 +161,7 @@
 →Getするところでlengthが0になったもしくは
 破棄をしていたらdisposeする
 
-##### BlockingQueue使用箇所(Dispoes処理)
+#### BlockingCollection使用箇所(Dispoes処理)
 * Connection
 * DataGears → fin
 * WaitList → fin
@@ -302,6 +302,24 @@
 優先度をつけるならThreadPoolはTaskを利用できないかも
 
 ---
+Task.RunとTask.Factory.Startnewについて
+
+無限ループさせるような、すぐには終了しないTaskについては
+LongRunオプションをつける必要がある。
+
+これは、Task.Runは裏でThreadPoolを作るが、この数がTask.Runの場合規定数(通常だと16(cpuに依存))に制限されており、無限ループのTaskも個の規定数にカウントされてしまうため  
+https://oita.oika.me/2016/02/18/task-and-threadpool/  
+
+それを避けるためにStartnewでTaskを作成する  
+
+https://qiita.com/chocolamint/items/3e2e4951ea0fa2ccd19e
+
+---
+C#のTaskでのThreadPoolについて  
+
+https://stackoverflow.com/questions/35734051/c-sharp-task-thread-pool-running-100-tasks-across-only-10-threads  
+
+---
 ## TODO
 * annotation → fin
 * daemon
@@ -320,6 +338,7 @@
         * ThreadPoolExecutorとは
     * CodeGearExecutor
         * cgm要実装
+        * cg要実装
 * datagear
     * command
         * Command → fin
--- a/Christie/for.NET/優先度つきThreadPool.md	Sun Jan 03 00:10:04 2021 +0900
+++ b/Christie/for.NET/優先度つきThreadPool.md	Mon Jan 04 00:10:03 2021 +0900
@@ -134,7 +134,8 @@
 ThreadPoolExecutorを継承したPriorityThreadPoolExecutorクラス  
 デフォルトの優先度は0  
 スレッド数と生存時間を指定
-→スレッド数はcpu数によって変わる `Runtime.getRuntime().availableProcessors()`  
+→スレッド数はcpu数によって変わる  (確かめたところ16だった)
+`Runtime.getRuntime().availableProcessors()`  
 https://stackoverflow.com/questions/11877947/runtime-getruntime-availableprocessors  
 c#だとこっち  
 https://oita.oika.me/2016/02/18/task-and-threadpool/  
@@ -182,3 +183,8 @@
 → 1なら入れ替える  
 
 0の場合優先度の差がないので、instance生成順で並び替える  
+
+---
+## 参考ページ
+http://normalse.hatenablog.jp/entry/2015/04/03/075443  
+https://qiita.com/sano1202/items/64593e8e981e8d6439d3  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/user/anatofuz/note/2021/01/03.md	Mon Jan 04 00:10:03 2021 +0900
@@ -0,0 +1,27 @@
+# 2021/01/03
+
+# Linux環境
+
+- Manjaro諦めてUbuntuにした
+    - 正直まだManjaro使ってみたい
+    - kernel updateすると死にやすいので初手は厳しいかもしれない・・・
+    - pacmanがmanjaroに関しては便利
+- apt結構古い
+    - nixと併用
+    - GUIアプリはsnapでいれる
+        - mattermost
+        - bitwarden
+        - steam
+        - vscode
+        - chrome
+
+- pacman使いたいとこに目をつぶれば結構使える
+    - macのコマンドキーは偉大っすね...
+    - thinkpadのキーボードはそこそこ打ちやすい
+
+- とりあえずgccとllvmは構築
+    - amaneのsingularityも動いた
+
+- 自分で作っていたツールもだいたい動いた
+    - perlとgolang製なので移植がわりと簡単
+    - linuxbrewは今回は使わない方向で(特に意味はない)