Opened 11 years ago

Closed 10 years ago

#2332 closed defect (fixed)

Thread-safe runtime system

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone: 1.9.1
Component: Run-time Version: trunk
Keywords: Cc:

Description (last modified by Martin Sjölund)

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 by Martin Sjölund, 11 years ago

Owner: changed from somebody to Martin Sjölund
Status: newaccepted

comment:2 by Martin Sjölund, 11 years ago

Thread-local storage possible to mimic globals

comment:3 by Martin Sjölund, 11 years ago

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

comment:4 by Martin Sjölund, 11 years ago

Description: modified (diff)

comment:5 by Martin Sjölund, 11 years ago

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 by Martin Sjölund, 10 years ago

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

comment:7 by Martin Sjölund, 10 years ago

Milestone: 2.0.01.9.1
Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.