------- Comment #3 from pinskia at gcc dot gnu dot org 2006-02-24 22:38 ------- (In reply to comment #2) > (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.
Why not let the OS do its job? I still don't understand that idea. Actually no it is not responable in general since GCC assumes the address is invariant which is correct except for your little weird case. What function are you using to save/restore the context? There are no standard C function which allows for that. Even get/setcontext are POSIX but I doubt they support across threads correctly anyways. I know setjmp/longjmp don't for sure. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26461