[Stackless-checkins] CVS: slpdev/src/2.3/dev/Stackless/core stackless_impl.h, 1.89, 1.90 stacklesseval.c, 1.150, 1.151
Christian Tismer
tismer at centera.de
Thu Jun 3 01:03:46 CEST 2004
Update of /home/cvs/slpdev/src/2.3/dev/Stackless/core
In directory centera.de:/tmp/cvs-serv3004/Stackless/core
Modified Files:
stackless_impl.h stacklesseval.c
Log Message:
Stackless 3.1 almost ready.
All tests are working, both Python and Stackless,
both soft and hard switching.
New features:
channels are working cross-thread!
Stack protection for eval_frame and pickling is complete.
A couple of smallish features are missing:
pickling of channels
refuse running tasklets from foreign threads
channel.transfer
scheduling strategy cross-thread
cframe pickling, get rid of invalid_exec funcs, instead use
the missing cframe owner-tasklet pointer!
add more tests!
Index: stackless_impl.h
===================================================================
RCS file: /home/cvs/slpdev/src/2.3/dev/Stackless/core/stackless_impl.h,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -d -r1.89 -r1.90
*** stackless_impl.h 24 May 2004 01:05:17 -0000 1.89
--- stackless_impl.h 2 Jun 2004 23:03:43 -0000 1.90
***************
*** 26,35 ****
*/
- /* extract the lower bit of Py_TPFLAGS_HAVE_STACKLESS_EXTENSION */
-
- #define Py_TPFLAGS_HAVE_STACKLESS_CALL \
- (Py_TPFLAGS_HAVE_STACKLESS_EXTENSION & \
- (Py_TPFLAGS_HAVE_STACKLESS_EXTENSION >> 1))
-
/********************************************************************
*
--- 26,29 ----
***************
*** 109,113 ****
PyAPI_FUNC(struct _frame *) slp_ensure_new_frame(struct _frame *f);
! /* exposing the generator type */
PyAPI_DATA(PyTypeObject) PyGenerator_Type;
--- 103,107 ----
PyAPI_FUNC(struct _frame *) slp_ensure_new_frame(struct _frame *f);
! /* exposing some hidden types */
PyAPI_DATA(PyTypeObject) PyGenerator_Type;
***************
*** 116,120 ****
#define PyGenerator_Check(op) PyObject_TypeCheck(op, &PyGenerator_Type)
! /* exposing the method wrapper type for pickling */
PyAPI_DATA(PyTypeObject) PyMethodWrapper_Type;
--- 110,115 ----
#define PyGenerator_Check(op) PyObject_TypeCheck(op, &PyGenerator_Type)
! PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
! PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type;
PyAPI_DATA(PyTypeObject) PyMethodWrapper_Type;
***************
*** 161,164 ****
--- 156,166 ----
(stackless ? slp_try_stackless = (flag) : 0)
+ #define STACKLESS_PROMOTE_METHOD(obj, meth) \
+ (obj->ob_type->tp_flags & Py_TPFLAGS_HAVE_STACKLESS_EXTENSION ? \
+ slp_try_stackless = stackless & obj->ob_type->slpflags.meth : 0)
+
+ #define STACKLESS_PROMOTE_WRAPPER(wp) \
+ (slp_try_stackless = stackless & wp->descr->d_slpmask)
+
#define STACKLESS_PROMOTE_ALL() (slp_try_stackless = stackless, NULL)
***************
*** 175,178 ****
--- 177,184 ----
#define STACKLESS_ASSERT() assert(!slp_try_stackless)
+ /* this is just a tag to denote which methods are stackless */
+
+ #define STACKLESS_DECLARE_METHOD(type, meth)
+
/*
***************
*** 447,450 ****
--- 453,458 ----
#define STACKLESS_PROMOTE(func) stackless = 0
#define STACKLESS_PROMOTE_FLAG(flag) stackless = 0
+ #define STACKLESS_PROMOTE_METHOD(obj, meth) stackless = 0
+ #define STACKLESS_PROMOTE_WRAPPER(wp) stackless = 0
#define STACKLESS_PROMOTE_ALL() stackless = 0
#define STACKLESS_PROPOSE(func) assert(1)
***************
*** 454,457 ****
--- 462,467 ----
#define STACKLESS_ASSERT() assert(1)
+ #define STACKLESS_DECLARE_METHOD(type, meth)
+
#endif /* STACKLESS */
Index: stacklesseval.c
===================================================================
RCS file: /home/cvs/slpdev/src/2.3/dev/Stackless/core/stacklesseval.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -C2 -d -r1.150 -r1.151
*** stacklesseval.c 24 May 2004 01:45:39 -0000 1.150
--- stacklesseval.c 2 Jun 2004 23:03:43 -0000 1.151
***************
*** 356,365 ****
--- 356,370 ----
PyTaskletObject *cur = ts->st.current;
PyCStackObject *cst = cur->cstate;
+ PyCFrameObject *cf = (PyCFrameObject *) f;
+ ts->st.nesting_level = cf->n;
ts->frame = f->f_back;
Py_DECREF(f);
+ cur->cstate = NULL;
retval = PyEval_EvalFrame(ts->frame, retval);
TASKLET_SETVAL_OWN(cur, retval);
/* jump back */
+ Py_XDECREF(cur->cstate);
+ cur->cstate = cst;
slp_transfer_return(cst);
/* never come here */
***************
*** 386,389 ****
--- 391,395 ----
if (cf == NULL)
return NULL;
+ cf->n = ts->st.nesting_level;
ts->frame = (PyFrameObject *) cf;
cst = cur->cstate;
_______________________________________________
Stackless-checkins mailing list
Stackless-checkins at stackless.com
http://www.stackless.com/mailman/listinfo/stackless-checkins
More information about the Stackless-checkins
mailing list