Boost logo

Boost :

Subject: Re: [boost] [context] Implementation comments
From: Oliver Kowalke (k-oli_at_[hidden])
Date: 2011-01-20 05:46:01


> What I meant is that Boost.Context could provide a low level inteface
> (similar to the one ucontext_t provides) which will be implemented possibily in
> assembler, use ucontext_t or Windows Fibers.
>
> namespace boost {
> namespace contexts {
> struct fcontext_t {...};
> int get_fcontext( fcontext_t& fc);
> int set_fcontext( fcontext_t const& fc);
> int swap_fcontext( fcontext_t & ofc, fcontext_t const& nfc);
> int fill_fcontext( fcontext_t & fc, std::size_t size, void* stack_ptr,
> fcontext_t * next);
> int make_fcontext( fcontext_t & fc, void (* fn)( void *), void * p);
> }}
>
> With this minimal inteface we can create higher abstractions with a lower
> overhead.

Sorry - I don't get it.
The fcontext stuff is only another implementation to store and restore registers,CPU flags and stack pointer (does the same as ucontext and Win Fibers stuff).
The functions you listed are implemented in assembler using fcontext_t as data container. I don't see how this functions should abstract ucontext_t (setcontext(ucontext_t *), getcontext(ucontext_*), swapcontext( ucontext_t*,ucontext_t*), etc.) and Windows Fibers (CreateFiber(), SwitchToFiber() )?

so long, Oliver

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk