狠狠撸

狠狠撸Share a Scribd company logo
マルチスレッドプログラミング
はじめました
2017/12/16
Soichiro Sugimoto
自己紹介
ニックネーム: sotan
最近試していること:HoloLens+THETA で Image-Based Lighting (IBL)
2
最近試していること(デモ動画)
3
https://www.youtube.com/watch?v=VPiRsorb_0Yhttps://www.youtube.com/watch?v=aGi9VFo1JIU
問題点
? フレームレートが低い(処理落ち)
? 環境マップの更新タイミングが遅い(カメラ位置の移動に対して遅延)
4
平均15fps未満????
問題点
? フレームレートが低い(処理落ち)
? 環境マップの更新タイミングが遅い(カメラ位置の移動に対して遅延)
5
平均15fps未満????
現状のパフォーマンスでは本来やりたいことができないので何とかしたい
HoloLensの性能でどこまでできるか試したい
HoloLensについて復習
6
参考1: HoloLens - 真のエンジニアが知るべき実装(/decode2017/mr03-hololens)
参考2: 日経エレクトロニクス, 2017年4月号, pp.71-80, 「HoloLens」分解で見えた神髄、“見る”SLAM、“見せる”光学系
OS:Windows 10
CPU: Atom x5-Z8100 1.04GHz (4コア?4スレッド)
メモリ:1GB× 2
ストレージ:64GB
重量:579g
実機で論理コア数を確認
7
4コアだった(SystemInfo.processorCount)
実機で論理コア数を確認
8
4コアだった(SystemInfo.processorCount)
マルチコアCPUなんだから
マルチスレッドで処理すれば
速くなるんじゃない?
はじめてのマルチスレッド(非同期処理)
9
計算負荷の高い処理
Task.Runを使ってみた(環境:Unity 2017.1.2f1)
https://github.com/sotanmochi/MultiThreadSample
はじめてのマルチスレッド(非同期処理)
10
Player Settings > Other Settings > Scripting Runtime Version を変更しておく
はじめてのマルチスレッド(非同期処理)
11
スクリプト全体はこんな感じ
はじめてのマルチスレッド(非同期処理)
12
スクリプト全体はこんな感じ
IBLの処理をマルチスレッド化(鋭意実装中)
13
レスポンスからMJPG画像取得
天球モデルの回転を更新
天球モデルに
全天周画像を投影する
RenderToCubemap
Raspberry Piへリクエスト送信
主な処理の流れ
球面調和関数展開(SH展開)の
係数を更新
データ受信を別スレッドで非同期処理
一番のボトルネックはSH展開係数の計算
?ここの処理にコルーチンを使ったら
フレームレートが改善した(40fps程度)
画像処理?数値計算なので
別スレッドで非同期処理すれば改善できそう
画像処理?数値計算
画像データ受信
ありがとうございました
14

More Related Content

Recently uploaded (9)

PDF
安尾 萌, 藤代 裕之, 松下 光範. 協調的情報トリアージにおけるコミュニケーションの影響についての検討, 第11回データ工学と情報マネジメントに関する...
Matsushita Laboratory
?
PDF
安尾 萌, 松下 光範. 環境馴致を計量可能にするための試み,人工知能学会第4回仕掛学研究会, 2018.
Matsushita Laboratory
?
PPTX
Vibe Codingを始めよう ?Cursorを例に、ノーコードでのプログラミング体験?
iPride Co., Ltd.
?
PDF
論文紹介:AutoPrompt: Eliciting Knowledge from Language Models with Automatically ...
Toru Tamaki
?
PPTX
色について.pptx .
iPride Co., Ltd.
?
PDF
安尾 萌, 北村 茂生, 松下 光範. 災害発生時における被害状況把握を目的とした情報共有システムの基礎検討, 電子情報通信学会HCGシンポジウム2018...
Matsushita Laboratory
?
PPTX
勉強会_ターミナルコマント?入力迅速化_20250620. pptx. .
iPride Co., Ltd.
?
PDF
Forguncy 10 製品概要資料 - ノーコードWebアプリ開発プラットフォーム
フォーガンシー
?
PDF
論文紹介:Unbiasing through Textual Descriptions: Mitigating Representation Bias i...
Toru Tamaki
?
安尾 萌, 藤代 裕之, 松下 光範. 協調的情報トリアージにおけるコミュニケーションの影響についての検討, 第11回データ工学と情報マネジメントに関する...
Matsushita Laboratory
?
安尾 萌, 松下 光範. 環境馴致を計量可能にするための試み,人工知能学会第4回仕掛学研究会, 2018.
Matsushita Laboratory
?
Vibe Codingを始めよう ?Cursorを例に、ノーコードでのプログラミング体験?
iPride Co., Ltd.
?
論文紹介:AutoPrompt: Eliciting Knowledge from Language Models with Automatically ...
Toru Tamaki
?
色について.pptx .
iPride Co., Ltd.
?
安尾 萌, 北村 茂生, 松下 光範. 災害発生時における被害状況把握を目的とした情報共有システムの基礎検討, 電子情報通信学会HCGシンポジウム2018...
Matsushita Laboratory
?
勉強会_ターミナルコマント?入力迅速化_20250620. pptx. .
iPride Co., Ltd.
?
Forguncy 10 製品概要資料 - ノーコードWebアプリ開発プラットフォーム
フォーガンシー
?
論文紹介:Unbiasing through Textual Descriptions: Mitigating Representation Bias i...
Toru Tamaki
?

Featured (20)

PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
?
PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
?
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
?
PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
?
PDF
2024 State of Marketing Report – by Hubspot
Marius Sescu
?
PDF
Everything You Need To Know About ChatGPT
Expeed Software
?
PDF
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
?
PDF
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
?
PDF
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
?
PDF
Skeleton Culture Code
Skeleton Technologies
?
PDF
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
?
PDF
Content Methodology: A Best Practices Report (Webinar)
contently
?
PPTX
How to Prepare For a Successful Job Search for 2024
Albert Qian
?
PDF
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
?
PDF
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
?
PDF
5 Public speaking tips from TED - Visualized summary
SpeakerHub
?
PDF
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
?
PDF
Getting into the tech field. what next
Tessa Mero
?
PDF
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
?
PDF
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
?
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
?
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
?
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
?
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
?
2024 State of Marketing Report – by Hubspot
Marius Sescu
?
Everything You Need To Know About ChatGPT
Expeed Software
?
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
?
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
?
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
?
Skeleton Culture Code
Skeleton Technologies
?
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
?
Content Methodology: A Best Practices Report (Webinar)
contently
?
How to Prepare For a Successful Job Search for 2024
Albert Qian
?
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
?
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
?
5 Public speaking tips from TED - Visualized summary
SpeakerHub
?
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
?
Getting into the tech field. what next
Tessa Mero
?
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
?
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
?
Ad

マルチスレッドプログラミングはじめました