Hisanori-Suito / HumanDetection

0 stars 0 forks source link

onHandUpdate関数とonExecute関数がuserHandsに同時にアクセスすることはないのか? #2

Open Nobu19800 opened 2 years ago

Nobu19800 commented 2 years ago

NUITRACK SDKの詳細についてはよく知らないのですが、onHandUpdate関数はtdv::nuitrack::Nuitrack::waitUpdate関数を実行したタイミングで呼ばれるのでしょうか、それとも別スレッドで呼び出してtdv::nuitrack::Nuitrack::waitUpdate関数では待機するだけなのでしょうか? 仮に別スレッドで呼び出される場合、同時に変数userHandsに同時にアクセスするので何か問題が起こるかもしれません。

またNuitrackのサンプルコードではtdv::nuitrack::Nuitrack::waitUpdate関数で例外処理しているのですが、HumanDetection.cppではそれがないようなので、問題があった場合はエラー状態に遷移するようにしたほうがいいと思いました。

Hisanori-Suito commented 2 years ago

ご指摘頂きありがとうございます。 参考にさせて頂きながら、ソースコードをアップデートしていきたいと思います。

2021年12月14日(火) 13:12 Nobuhiko Miyamoto @.***>:

NUITRACK SDKの詳細についてはよく知らないのですが、onHandUpdate関数はtdv::nuitrack::Nuitrack::waitUpdate関数を実行したタイミングで呼ばれるのでしょうか、それとも別スレッドで呼び出してtdv::nuitrack::Nuitrack::waitUpdate関数では待機するだけなのでしょうか? 仮に別スレッドで呼び出される場合、同時に変数userHandsに同時にアクセスするので何か問題が起こるかもしれません。

またNuitrackのサンプルコードではtdv::nuitrack::Nuitrack::waitUpdate関数で例外処理しているのですが、HumanDetection.cppではそれがないようなので、問題があった場合はエラー状態に遷移するようにしたほうがいいと思いました。

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Hisanori-Suito/HumanDetection/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWWKD6TKYVTIUARRAEAMEMTUQ27ZRANCNFSM5J73DUJA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- 名城大学 理工学部 メカトロニクス工学科 180447039 水藤久憲 @.***