------- Comment #2 from yichen dot xie at gmail dot com  2006-02-24 22:12 
-------
(In reply to comment #1)
> It seems like you are trying to
> deal with your own threading system instead of allowing the OS do its work.
> 

This is indeed what I am trying to do, and C seems to be the perfect language
for doing this. I agree it's not common to be switching thread contexts across
function calls, but I don't think it should be prohibited by GCC.

In my case, "h" simply saves its context, put it on the ready queue, and waits
for another thread to pick it up and resume execution with the new thread local
copy of "array". So the question is there a way to force recompuation of
"&array[0]" after h? Is it reasonable to request for a mechanism to force
recomputation of "&array[0]"?

BTW, the solution IMO is simple: either make sure all thread local values and
addresses (the problem seems to exist only with arrays, the compiler is more
conservative dealing with pointers, etc) are dead after a function call, or add
a mechanism (__attribute__((thread_switch))?) to force it.


-- 

yichen dot xie at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yichen dot xie at gmail dot
                   |                            |com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26461

Reply via email to