Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Real Time parallel application

Discussion in 'Scripting' started by Alco6, Jun 14, 2019.

  1. Alco6

    Alco6

    Joined:
    Oct 19, 2018
    Posts:
    13
    Hello!
    I am struggling a bit with the usage of Threads in C#.
    I need to acquire data from a device and use Unity to visualize it and log it on a file. The acquisition should be in real time.
    I was thinking about a producer with multiple consumer, each one on a different thread.
    Which kind of Queue ( or any other cross-threading) mechanism between threads could I use to have the fastest response? I would like to know if there is anything that could allow me to write and read from the same queue with different threads. All of this without using locks in the queue that could make my application slow down.
    Thanks!
     
  2. WallaceT_MFM

    WallaceT_MFM

    Joined:
    Sep 25, 2017
    Posts:
    394
    Joe-Censored likes this.