Opened 11 years ago

Closed 10 years ago

#2332 closed defect (fixed)

Thread-safe runtime system

Reported by: sjoelund.se Owned by: sjoelund.se
Priority: high Milestone: 1.9.1
Component: Run-time Version: trunk
Keywords: Cc:

Description (last modified by sjoelund.se)

This is a collection of non-threadsafe parts that we probably should resolve for bootstrapping if we want to run parallel omc:

  • Message system (buffers)
  • Jump buffers (setjmp; global, stack overflow, simulation stuff (less important))
  • Java runtime (does anyone care?)
  • Compiler/runtime: Need to consider error-buffers in parallel. Probably each thread wants its own error-stack to manipulate
  • More?

Change History (7)

comment:1 Changed 11 years ago by sjoelund.se

  • Owner changed from somebody to sjoelund.se
  • Status changed from new to accepted

comment:2 Changed 11 years ago by sjoelund.se

Thread-local storage possible to mimic globals

comment:3 Changed 11 years ago by sjoelund.se

pthread_rwlock_t to lock most global variables (we write to them very rarely, but we should lock them anyway).

comment:4 Changed 11 years ago by sjoelund.se

  • Description modified (diff)

comment:5 Changed 11 years ago by sjoelund.se

An fast and dirty solution for external C functions would be to add an annotation __OpenModelica_Mutex=true or __OpenModelica_Mutex="Name_of_Mutex" to avoid several functions from using the same resource. It does not solve the problem of shared global roots or the error buffer (which some threads want to roll back).

comment:6 Changed 10 years ago by sjoelund.se

The threadData is now used for most of these things, making many external functions possible to use in parallel.

comment:7 Changed 10 years ago by sjoelund.se

  • Milestone changed from 2.0.0 to 1.9.1
  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.