On Fri, Dec 03, 2004, Stefan Brantschen wrote:

> I can successfully create (pth_uctx_create), make (pth_uctx_make), and
> switch from/to (pth_uctx_switch) my contexts.
>
> However, saving (pth_uctx_save) and restoring (pth_uctx_restore) a
> context results in a segmentation fault (signal 10) on restore. Also
> switching to a saved context causes a crash, from which I infer that I
> don't manage to _save_ my context properly in the first place, as the
> switch works otherwise.
>
> Is there anything specific I should observe? I understand that through
> calling pth_uctx_save anywhere in my thread I can restore the state at
> save-time anytime later through pth_uctx_restore, so that the thread
> continues right at the position of the previous save? Do I miss
> something?!

I think GNU Pth is using the MCSC machine context switching method
and there the boring getcontext(3) return semantics break GNU Pth's
pth_uctx_save(). I'm trying to find a workaround, but in the meantime
I guess you can workaround yourself by forcing GNU Pth to use a
different machine context switching method. For instance rebuild it with
--with-mctx-mth=sjlj and see what happens...

                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com

______________________________________________________________________
GNU Portable Threads (Pth)            http://www.gnu.org/software/pth/
Development Site                      http://www.ossp.org/pkg/lib/pth/
Distribution Files                          ftp://ftp.gnu.org/gnu/pth/
Distribution Snapshots                 ftp://ftp.ossp.org/pkg/lib/pth/
User Support Mailing List                            [EMAIL PROTECTED]
Automated List Manager (Majordomo)           [EMAIL PROTECTED]

Reply via email to