Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make sthread_inside_simgrid static into libsthread in the (vain) hope that it'll...
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 27 Jun 2022 20:01:03 +0000 (22:01 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 27 Jun 2022 20:05:56 +0000 (22:05 +0200)
commit73a0ae62cf92da83e861cfaf9ba0313cacbc4825
tree9e63a602e9fdf687c1076be4657acc30f218a865
parent971c99d7a8f442d2690aa22b48bcda640f722113
Make sthread_inside_simgrid static into libsthread in the (vain) hope that it'll help the init/fini phases

but unfortunately the symptoms are exactly the same:
- default builds work well with sthread LD_PRELOAD'ed
- MC builds segfault once the second thread starts in this case
- ns-3 builds deadlock in dl_init with sthread

I'm still commiting this because I believe that breaking the hard
dependency of sthread -> simgrid goes in the right direction: If
sthread is alone in memory without simgrid (as it may happen at
init/fini phases), it's a rather bad idea for sthread to use a
variable that lives in simgrid symbols.

Maybe I should load simgrid dynamically with libdl instead of
depending on it to further untighten the dependency, but I'd prefer to
understand. Plus, it'd only help at init phase and ns-3 builds are not
the ones I'd prefer to fix here.
examples/sthread/sthread-mutex-simple.c
src/kernel/context/Context.cpp
src/kernel/context/ContextSwapped.cpp
src/sthread/sthread.c
src/sthread/sthread.h
src/sthread/sthread_impl.cpp
src/xbt/xbt_main.cpp