Age | Commit message (Collapse) | Author |
|
|
|
|
|
ASSERT(code_writing_process != c_p);
The assert was actually harmless and could be removed as one solution.
But I think it's better to keep it as a way to catch bugs that would
otherwise lead to horrible deadlocks if a thread "forgets" to call
erts_release_code_write_permission().
As a result erts_release_code_write_permission() must be called BEFORE
resuming the suspended process.
|
|
|
|
The concept of code_write_permission is used by tracing as well
and is not specific to code_ix.
|
|
Simplify by removing the support of abort_staging after end_staging.
|
|
Rename lock_code_ix as seize_code_write_permission. Don't want to call
it a "lock" as it can be held between schedulings and different threads
and is not managed by lock checker.
Rename "activate" staging as "commit" staging. Why not be consistent
and use git terminology all the way.
|
|
Make for simpler code when we just can block threads and continue
without having to release code_ix lock and repeat code lookups to
avoid race.
|
|
Activation of staged code is scheduled for a later moment when
all schedulers have done a full memory barrier. This allow
them to read active code index while executing without any
memory barriers at all.
|
|
This will prevent blocking entrire schedulers in the rare case when
several processes are racing to load/upgrade/delete/purge code.
|
|
Move implementation from beam_load into new file code_ix.c and module.c
and make some function inline.
|
|
|
|
Staging is a better and more general name as does not necessary need
to involve code loading (can be deletion, tracing, etc).
|
|
Implemented some code_ix locks
and commented calls to erts_smp_thr_progress_block()
|
|
|
|
Still blocking code loading
|