1 |
Overview |
Overview |
2 |
======== |
======== |
3 |
|
|
4 |
Proposed new procedures: |
This proposal is for the introduction of three new procedures to |
5 |
|
replace the existing call-with-dynamic-root procedure and the |
6 |
|
corresponding C interfaces. The new procedures are supposed to be |
7 |
|
more useful for programs embedding Guile and would also move the |
8 |
|
concept of "dynamic roots" from the external API to become a thread |
9 |
|
implementation detail. |
10 |
|
|
11 |
|
The proposed new procedures are: |
12 |
|
|
13 |
with-continuation-barrier, implemented by |
with-continuation-barrier, implemented by |
14 |
scm_with_continuation_barrier in C. Takes 2 SCM arguments: a body |
scm_with_continuation_barrier in C. Takes 2 SCM arguments: a body |
59 |
the implementation looks a bit heavy for use in every callback. |
the implementation looks a bit heavy for use in every callback. |
60 |
|
|
61 |
scm_call_with_dynamic_root was implemented to support threading, so |
scm_call_with_dynamic_root was implemented to support threading, so |
62 |
the needs of libguile itself should be considered. Other |
the needs of guile-core itself should be considered. Other |
63 |
considerations are how any new interface interacts with error handling |
considerations are how any new interface interacts with error handling |
64 |
and reporting; whether a new interface is convenient to use from C; |
and reporting; whether a new interface is convenient to use from C; |
65 |
whether a new interface should also be available to Scheme code. |
whether a new interface should also be available to Scheme code. |
120 |
Why bother providing this kind of facility? Because otherwise most C |
Why bother providing this kind of facility? Because otherwise most C |
121 |
applications that link Guile will need to find some other way to |
applications that link Guile will need to find some other way to |
122 |
prevent the use of continuations across callbacks if they are to avoid |
prevent the use of continuations across callbacks if they are to avoid |
123 |
a source of bugs. It makes sense to provide this in libguile, where |
a source of bugs. It makes sense to provide this in guile-core, where |
124 |
the ability to modify the internals of the continuation implementation |
the ability to modify the internals of the continuation implementation |
125 |
is a significant advantage, as discussed further below. |
is a significant advantage, as discussed further below. |
126 |
|
|