hi,
i would like to use an existing piece of single-threaded
code in a multi-threaded way. but to do this there seems
no alternative to, say for posix, rigging it with
thread-specific-data related calls (phtread_key_create).
i would like to avoid accessing existing global variables
in this way simply because of the huge amount of work
involved in re-plumbing the code.
i had in mind the possibility of making the .data section
copy-on-write mmapped for each thread context. this would
suggest the need for code to be compiled to access this
area through some indirection pointer, which does not seem
too silly given PIC is a reality.
as experts on threading in the throes of creating a new implementation,
i was wondering whether one of you might
comment on the plausibility of this idea. indeed i wonder
whether this is not already in existence somewhere - if
you know of such i would be very interested to hear of it!