Commit | Line | Data |
---|---|---|
c6a040a8 NJ |
1 | 2002-12-28 Neil Jerram <neil@ossau.uklinux.net> |
2 | ||
3 | * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token, | |
4 | scm_lreadparen): Support reading vectors with Elisp syntax if | |
5 | SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS | |
6 | is not currently defined, and there isn't even a configure switch | |
7 | to enable it yet.) | |
8 | ||
3742c12f MV |
9 | 2002-12-26 Marius Vollmer <mvo@zagadka.ping.de> |
10 | ||
11 | * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath | |
12 | builds work. | |
13 | (EXTRA_DIST): Added version.h.in. | |
14 | ||
fb50ef08 MD |
15 | 2002-12-21 Mikael Djurfeldt <djurfeldt@nada.kth.se> |
16 | ||
17 | This change makes it possible for one thread to do lazy sweeping | |
18 | while other threads are running. Now only the mark phase need to | |
19 | have all threads asleep. We should look further into this issue. | |
20 | Presently, I've put the locking of scm_i_sweep_mutex at | |
21 | "conservative" places due to my current lack of knowledge about | |
22 | the garbage collector. Please feel free to restrict these regions | |
23 | further to allow for maximal parallelism! | |
24 | ||
25 | * gc.c, gc.h (scm_i_sweep_mutex): New mutex. | |
26 | ||
27 | * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc, | |
28 | scm_gc_register_collectable_memory): Substitute locking of | |
29 | scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep. | |
30 | (scm_igc): Lock sweep mutex here instead of in callers; Calls to | |
31 | scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate | |
32 | the single-thread section (which now only contains the mark | |
33 | phase). | |
34 | (scm_gc): Don't lock sweeo mutex here since scm_igc locks it; | |
35 | Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly. | |
36 | ||
37 | * threads.c (gc_section_mutex): Removed. | |
38 | ||
9ed24633 MD |
39 | 2002-12-19 Mikael Djurfeldt <mdj@kvast.blakulla.net> |
40 | ||
0d48aca5 MD |
41 | * threads.c (create_thread): Clear parent field in root state in |
42 | order not to unnecessarily remember dead threads. | |
43 | ||
9ed24633 MD |
44 | * eval.c (call_subr2o_1, call_lsubr2_2): New functions. |
45 | (scm_trampoline_1, scm_trampoline_2): Use them. | |
46 | ||
29717c89 MD |
47 | 2002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net> |
48 | ||
49 | Partial introduction of real plugin interface. | |
50 | ||
51 | * Makefile.am (modinclude_HEADERS): Added threads-plugin.h. | |
52 | (EXTRA_DIST): Added threads-plugin.c. | |
53 | ||
54 | * threads-plugin.h, threads-plugin.c: New files. | |
55 | ||
56 | * threads.h: #include "libguile/threads-plugin.h". | |
57 | ||
58 | * threads.c: #include "libguile/threads-plugin.c". | |
59 | ||
60 | * pthread-threads.c: Temporarily remove debugging functions. | |
61 | ||
62 | * threads.c, threads.h (scm_yield): Added back. | |
63 | ||
e29e0b09 MD |
64 | 2002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net> |
65 | ||
66 | * threads.c (really_launch): Detach before unlocking | |
67 | thread_admin_mutex in order not to risk being joined. | |
68 | (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep | |
69 | thread_admin_mutex locked during GC. | |
70 | ||
71 | * pthread-threads.c, pthread-threads.h: Improvements to debugging | |
72 | functions. | |
73 | ||
0b6843b1 | 74 | 2002-12-16 Mikael Djurfeldt <mdj@kvast.blakulla.net> |
93cd4dcd | 75 | |
6da2dfc4 MD |
76 | * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added |
77 | support for debugging mutex operations. | |
78 | ||
1b92fb6b MD |
79 | * threads.c (scm_thread): Removed filed joining_threads. |
80 | (thread_print): Print thread number as well as address of thread | |
81 | structure. | |
0b6843b1 MD |
82 | (scm_join_thread): Bugfix. |
83 | (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex, | |
84 | scm_timed_wait_condition_variable, scm_signal_condition_variable, | |
85 | scm_broadcast_condition_variable): Use the low-level API. | |
86 | (scm_all_threads): Return copy of thread list (to prevent | |
87 | unintended destruction). | |
88 | (scm_threads_prehistory): Initialize heap_mutex of fake thread. | |
1b92fb6b | 89 | |
93cd4dcd MD |
90 | * pthread-threads.c, pthread-threads.h, threads.c: Fixes to |
91 | pthread "native" recursive mutex support. | |
92 | ||
2ff4f181 MD |
93 | 2002-12-15 Mikael Djurfeldt <djurfeldt@nada.kth.se> |
94 | ||
28d52ebb MD |
95 | * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions. |
96 | Simply lock a thread C API recursive mutex. | |
97 | (SCM_NONREC_CRITICAL_SECTION_START, | |
98 | SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START, | |
99 | SCM_REC_CRITICAL_SECTION_END): Removed. | |
100 | ||
101 | * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with | |
102 | direct calls to scm_rec_mutex_lock / unlock around the three calls | |
103 | to scm_m_expand_body. | |
104 | ||
105 | * eval.c, eval.h (promise_free): New function. | |
106 | (scm_force): Rewritten; Now thread-safe; Removed | |
107 | SCM_DEFER/ALLOW_INTS. | |
108 | ||
109 | * pthread-threads.h: Added partially implemented plugin interface | |
110 | for recursive mutexes. These are, for now, only intended to be | |
111 | used internally within the Guile implementation. | |
112 | ||
113 | * pthread-threads.c: New file. | |
114 | ||
115 | * threads.c: Conditionally #include "pthread-threads.c". | |
116 | ||
117 | * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be | |
118 | thread-safe; | |
119 | ||
120 | * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX, | |
121 | SCM_GLOBAL_REC_MUTEX): New macros. | |
122 | ||
123 | * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section | |
124 | macros---use mutexes instead. | |
125 | ||
126 | * tags.h (SCM_IM_FUTURE): New tag. | |
127 | ||
128 | * eval.c (scm_m_future): New primitive macro. | |
129 | (SCM_CEVAL): Support futures. | |
130 | (unmemocopy): Support unmemoization of futures. | |
131 | ||
132 | * print.c (scm_isymnames): Name of future isym. | |
133 | ||
2ff4f181 MD |
134 | * version.c: Unmade some changes to my private copy that got |
135 | committed by mistake. | |
136 | ||
392d2833 MD |
137 | 2002-12-11 Mikael Djurfeldt <mdj@kvast.blakulla.net> |
138 | ||
e200ddee MD |
139 | * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of |
140 | 2002-12-10. | |
141 | ||
392d2833 MD |
142 | * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists. |
143 | ||
144 | * gc.c (scm_gc_sweep): Call it here instead, which is a more | |
145 | logical place. | |
146 | ||
147 | * threads.c (create_thread): Remember root object until the handle | |
148 | of the new thread is on all_threads list. | |
149 | ||
150 | * root.c (scm_make_root): Moved copying of fluids until after | |
151 | creation of root handle so that the fluids are GC protected. Also | |
152 | removed the critical section. | |
153 | ||
c4c52ebe MD |
154 | 2002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net> |
155 | ||
960c408c MD |
156 | * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function. |
157 | ||
3cdde9d6 | 158 | * gc-malloc.c (malloc_mutex): New mutex. |
960c408c | 159 | (scm_gc_malloc_prehistory): Initialize it. |
3cdde9d6 MD |
160 | (scm_realloc): Serialize call to realloc |
161 | (scm_calloc): Same for calloc. | |
162 | Thanks to Wolfgang Jaehrling! | |
163 | (Now we have to make sure all calls to malloc/realloc are made | |
164 | through scm_malloc.) | |
165 | ||
960c408c MD |
166 | * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory. |
167 | ||
c4c52ebe MD |
168 | * threads.c (really_launch): Release heap (to prevent deadlock). |
169 | (create_thread): Release heap before locking thread admin mutex. | |
170 | ||
b0dc3d71 MD |
171 | 2002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net> |
172 | ||
173 | * threads.c (scm_i_thread_invalidate_freelists): New | |
174 | function. | |
175 | ||
176 | * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists. | |
177 | ||
178 | * modules.c (scm_export): Inserted a return statement. | |
179 | ||
06e80f59 HWN |
180 | 2002-12-10 Han-Wen Nienhuys <hanwen@cs.uu.nl> |
181 | ||
182 | * modules.c (scm_export): new function | |
183 | ||
184 | * gc-card.c: add a note about malloc()/free() overhead. | |
185 | ||
a12611c3 MD |
186 | 2002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net> |
187 | ||
188 | * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c | |
189 | in srcdir. | |
190 | ||
c7fabadf MD |
191 | 2002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se> |
192 | ||
193 | These changes remove scm_ints_disabled (which hasn't has any | |
194 | effect in Guile for quite some time). | |
195 | ||
196 | * async.c, error.h (scm_ints_disabled): Removed. | |
197 | ||
198 | * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1), | |
199 | root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK, | |
200 | SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled. | |
201 | (old_ints): Removed. | |
202 | ||
203 | * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive | |
204 | critical section. | |
205 | (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and | |
206 | SCM_ALLOW_INTS. | |
207 | ||
9bc4701c MD |
208 | 2002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se> |
209 | ||
52340b65 MD |
210 | * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait): |
211 | Removed accidental #if 0 around these functions. | |
212 | ||
9bc4701c MD |
213 | These changes are the start of support for preemptive |
214 | multithreading. Marius and I have agreed that I commit this code | |
215 | into the repository although it isn't thoroughly tested and surely | |
216 | introduces many bugs. The bugs should only be exposed when using | |
217 | threads, though. Signalling and error handling for threads is | |
218 | very likely broken. Work on making the implementation cleaner and | |
219 | more efficient is needed. | |
220 | ||
221 | * __scm.h (SCM_ALLOW_INTS_ONLY): Removed. | |
222 | (SCM_NONREC_CRITICAL_SECTION_START, | |
223 | SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START, | |
224 | SCM_REC_CRITICAL_SECTION_END): New macros. | |
225 | (SCM_CRITICAL_SECTION_START/END): Defined here. | |
226 | ||
227 | * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around | |
228 | the three calls to scm_m_expand_body. | |
229 | ||
230 | * gc.h: #include "libguile/pthread-threads.h"; | |
231 | (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros. | |
232 | ||
233 | * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type | |
234 | scm_t_key; | |
235 | ||
236 | * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist | |
237 | access. | |
238 | ||
239 | * gc-freelist.c (scm_gc_init_freelist): Create freelist keys. | |
240 | ||
241 | * gc-freelist.c, threads.c (really_launch): Use | |
242 | SCM_FREELIST_CREATE. | |
243 | ||
244 | * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory): | |
245 | ||
246 | * gc.c (scm_i_expensive_validation_check, scm_gc, | |
247 | scm_gc_for_newcell): Put threads to sleep before doing GC-related | |
248 | heap administration so that those pieces of code are executed | |
249 | single-threaded. We might consider rewriting these code sections | |
250 | in terms of a "call_gc_code_singly_threaded" construct instead of | |
251 | calling the pair of scm_i_thread_put_to_sleep () and | |
252 | scm_i_thread_wake_up (). Also, we would want to have as many of | |
253 | these sections eleminated. | |
254 | ||
255 | * init.c (scm_init_guile_1): Call scm_threads_prehistory. | |
256 | ||
257 | * inline.h: #include "libguile/threads.h" | |
258 | ||
259 | * pthread-threads.h: Macros now conform more closely to the | |
260 | pthreads interface. Some of them now take a second argument. | |
261 | ||
262 | * threads.c, threads.h: Many changes. | |
263 | ||
264 | 2002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se> | |
265 | ||
266 | * Makefile.am (version.h): Changed $^ --> $< in rule for | |
267 | version.h. | |
268 | ||
b2cbe8d8 RB |
269 | 2002-12-08 Rob Browning <rlb@defaultvalue.org> |
270 | ||
271 | * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now. | |
272 | (SCM_MINOR_VERSION): use @--@ substitution now. | |
273 | (SCM_MICRO_VERSION): use @--@ substitution now. | |
274 | (scm_effective_version): new function prototype. | |
275 | ||
276 | * version.c (scm_effective_version): new function, also add | |
277 | effective-version. | |
278 | ||
279 | * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION. | |
280 | (libpath.h): use GUILE_EFFECTIVE_VERSION to compute | |
281 | SCM_LIBRARY_DIR. | |
282 | (version.h): generate this here rather than configure.in. This | |
283 | approach tracks source edits better (i.e. more immediately). | |
284 | Might be worth considering for other .in files too. | |
285 | ||
5441c65c MV |
286 | 2002-12-02 Marius Vollmer <mvo@zagadka.ping.de> |
287 | ||
288 | Reorganized thread package selection. A thread package now only | |
289 | implements a small set of pthread like functions and Guile | |
290 | implements the rest on top of that. Guile's implementation is | |
291 | what the "coop-pthreads" package has been previously. Support for | |
292 | "coop" threads has been removed until I get time to add it again. | |
293 | ||
294 | * Makefile.am (libguile_la_SOURCES): Removed iselect.c. | |
295 | (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c, | |
296 | null-threads.c, coop-pthreads.c. | |
297 | (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added | |
298 | pthread-threads.h. | |
299 | ||
300 | * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h. | |
301 | ||
302 | * threads.h: Do not include "libguile/coop-defs.h". Include | |
303 | "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed | |
304 | (previously deprecated) C level thread API prototypes. They are | |
305 | now in the thread package specific headers, "null-threads.h" and | |
306 | "pthread-threads.h". | |
307 | (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR): | |
308 | New. | |
309 | (scm_threads_init): Removed. | |
310 | (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END, | |
311 | SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter, | |
312 | SCM_I_THREAD_SWITCH_COUNT): Define here. | |
313 | (scm_single_thread_p): Removed. | |
314 | (scm_call_with_new_thread): Take two args directly instead of list | |
315 | of two args. | |
316 | (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA, | |
317 | SCM_SET_THREAD_LOCAL_DATA): Define here. | |
318 | ||
319 | * threads.c: Merged with "coop-pthreads.c". | |
320 | ||
321 | * null-threads.h: Implement pthread-like API as a set of macros. | |
322 | ||
323 | * pthread-threads.h: New, implement pthread-like API by deferring | |
324 | to pthread itself. | |
325 | ||
326 | * init.c (scm_init_guile_1): Do not call scm_init_iselect, which | |
327 | has been lost in the reorganization. | |
328 | ||
504d99c5 MD |
329 | 2002-12-01 Mikael Djurfeldt <mdj@linnaeus> |
330 | ||
331 | The following change makes it possible to move procedure | |
332 | application dispatch outside inner loops. The motivation was | |
333 | clean implementation of efficient replacements of R5RS primitives | |
334 | in SRFI-1. | |
335 | ||
336 | The semantics is clear: scm_trampoline_N returns an optimized | |
337 | version of scm_call_N (or NULL if the procedure isn't applicable | |
338 | on N args). | |
339 | ||
340 | Applying the optimization to map and for-each increases efficiency | |
341 | noticeably. For example, (map abs ls) is 8 times faster than | |
342 | before. | |
343 | ||
344 | * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types. | |
345 | ||
346 | * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions. | |
347 | ||
348 | * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions; | |
349 | (map, for-each): Handle also application on two args as a special | |
350 | case; Use trampolines. | |
351 | ||
352 | Other changes: | |
353 | ||
354 | * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o; | |
355 | (subr2oless): Removed. | |
356 | (scm_restricted_vector_sort_x): Use scm_return_first to keep the | |
357 | vector GC protected. | |
358 | ||
359 | * eval.c (check_map_args): Use scm_out_of_range_pos instead of | |
360 | scm_out_of_range. | |
361 | ||
63dd3413 DH |
362 | 2002-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de> |
363 | ||
364 | * evalext.[ch] (scm_m_undefine, undefine): Deprecated. | |
365 | ||
4ba5f279 MD |
366 | 2002-11-17 Mikael Djurfeldt <mdj@linnaeus> |
367 | ||
368 | * debug.c (scm_make_iloc): Added missing "return". | |
369 | ||
56ae231f MV |
370 | 2002-11-17 Marius Vollmer <mvo@zagadka.ping.de> |
371 | ||
372 | * strports.c (scm_eval_string_in_module): Validate second arg to | |
373 | be a module. Thanks to Arno Peters! | |
374 | ||
80b28865 DH |
375 | 2002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de> |
376 | ||
377 | * .cvsignore: remove goops.c | |
378 | ||
c88b1456 DH |
379 | 2002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de> |
380 | ||
381 | * modules.c (scm_env_top_level, scm_lookup_closure_module, | |
382 | module_variable, scm_module_lookup_closure, | |
383 | scm_module_transformer, scm_sym2var, scm_module_reverse_lookup, | |
384 | scm_system_module_env_p): Don't compare SCM values with C | |
385 | operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP | |
386 | over SCM_NFALSEP. | |
387 | ||
a8a19efc DH |
388 | 2002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de> |
389 | ||
390 | * eval.h (SCM_MAKE_ILOC): New macro. | |
391 | ||
392 | * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing | |
393 | the iloc bitpattern here. | |
394 | ||
76734914 MD |
395 | 2002-11-14 Mikael Djurfeldt <mdj@linnaeus> |
396 | ||
397 | * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be | |
398 | part of the API, otherwise it's difficult to write Guile | |
399 | extensions using non-blocking I/O => moved #include | |
400 | "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h. | |
401 | ||
402 | * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex --> | |
403 | s_unlock_mutex. | |
404 | ||
8b5b4a75 MV |
405 | 2002-11-10 Marius Vollmer <mvo@zagadka.ping.de> |
406 | ||
407 | * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They | |
408 | are defined in configure.in. | |
409 | ||
410 | * threads.c: Removed SCM_API from function definitions. SCM_API | |
411 | is only for declarations. | |
412 | ||
e5a83084 MD |
413 | 2002-11-07 Mikael Djurfeldt <mdj@linnaeus> |
414 | ||
9be8bb45 MD |
415 | * coop-pthreads.h: Added support for thread specific data to the |
416 | generic C API for the coop-pthreads case. | |
417 | ||
e5a83084 MD |
418 | * threads.c, threads.h (scm_cond_init): Undo unintentional API |
419 | change. | |
6c214b62 | 420 | (scm_cond_broadcast): Added missing function. |
e5a83084 | 421 | |
7edf178e MV |
422 | 2002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de> |
423 | ||
424 | * coop.c (coop_next_runnable_thread): Removed, wich should have | |
425 | happened when GUILE_ISELECT was hard-wired. | |
426 | ||
7f5b1b77 MV |
427 | 2002-11-03 Marius Vollmer <mvo@zagadka.ping.de> |
428 | ||
7caa1b07 MV |
429 | * Makefile.am (libguile_la_SOURCES): Added threads.c |
430 | (DOT_DOC_FILES): Added threads.doc. | |
431 | (DOT_X_FILES): Added threads.x. | |
432 | (EXTRA_libguile_la_SOURCES): Removed threads.c. | |
433 | (noinst_HEADERS): Added coop-pthreads.c. | |
434 | (modinclude_HEADERS): Added coop-pthreads.h. | |
435 | ||
436 | * __scm.h (USE_THREADS, GUILE_ISELECT): Define when | |
437 | SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile. | |
438 | ||
bb11cbf4 MV |
439 | * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H. |
440 | Thanks to Bill Schottstaedt! | |
441 | ||
1d4cbbed MV |
442 | * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0. |
443 | ||
7f5b1b77 MV |
444 | * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when |
445 | SCM_COPT_THREADS is defined. | |
446 | (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS | |
447 | is defined. | |
448 | ||
449 | * coop-pthreads.c: Some harmless renamings of internal stuff. | |
450 | (create_thread): New, generalized version of | |
451 | scm_call_with_new_thread. | |
452 | (scm_call_with_new_thread): Use it. | |
453 | (scm_spawn_thread): New, use create_thread. | |
454 | ||
d52f53b1 MV |
455 | 2002-11-02 Marius Vollmer <mvo@zagadka.ping.de> |
456 | ||
457 | * coop-pthreads.c, coop-pthreads.h: Redone completely, you might | |
458 | start testing it now. | |
459 | ||
460 | * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly | |
461 | defined when HAVE_RESTARTABLE_SYSCALLS is not defined. | |
462 | (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS | |
463 | is defined. | |
464 | ||
30f920c3 MV |
465 | 2002-10-27 Marius Vollmer <mvo@zagadka.ping.de> |
466 | ||
467 | * scmsigs.c (signal_cell_handlers, install_handler_data, | |
468 | scm_delq_spine_x, really_install_handler, install_handler): New | |
469 | scheme for triggering signal handlers, to simplify take_signal. | |
470 | (take_signal): Simplified, to avoid race conditions. | |
471 | (scm_sigaction_for_thread): Use new Scheme. Validate that thread | |
472 | hasn't exited yet. | |
473 | ||
474 | * async.c (scm_async_click): Reset pending_asyncs, handle | |
475 | signal_asyncs. Don't set cdr of a non-signal async to #f. | |
476 | (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue | |
477 | always. Set pending_asyncs. | |
478 | (scm_system_async_mark_for_thread): Check that thread has not | |
479 | exited. | |
480 | (scm_unmask_signals, decrease_block): Call scm_async_click after | |
481 | block_asyncs becomes zero. | |
482 | ||
483 | * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of | |
484 | active_asyncs. | |
485 | ||
486 | * root.h (scm_root_state): Added pending_asyncs and signal_asyncs | |
487 | fields. | |
488 | * root.c (root_mark): Mark them. | |
489 | (make_root): Initialize them. | |
490 | ||
491 | * iselect.c, iselect.h: Replaced GUILE_ISELECT with | |
492 | USE_COOP_THREADS. | |
493 | (scm_internal_select): Define one version for USE_COOP_THREADS and | |
494 | one for USE_NULL_THREADS. | |
495 | (scm_init_iselect): Likewise. | |
496 | ||
497 | * inline.h (scm_cell, scm_double_cell): Also allow | |
498 | USE_COPT_THREADS to not protect the slot initializers. | |
499 | ||
500 | * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is | |
501 | because threads need to be initialized before the stack, but | |
502 | gsubrs such as scm_timed_condition_variable_wait can only be | |
503 | created later. | |
504 | ||
505 | * threads.h: Include "coop-pthreads.h" when requested. | |
506 | (scm_threads_make_mutex, scm_threads_lock_mutex, | |
507 | scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were | |
508 | not implemented anyway. | |
509 | (scm_init_thread_procs, scm_try_mutex, | |
510 | scm_timed_condition_variable_wait, | |
511 | scm_broadcast_condition_variable, scm_c_thread_exited_p, | |
512 | scm_thread_exited_p): New prototypes. | |
513 | (struct timespec): Define if not already defined. | |
514 | (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock, | |
515 | scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init, | |
516 | scm_cond_wait, scm_cond_timedwait, scm_cond_signal, | |
517 | scm_cond_broadcast, scm_cond_destroy): Declarations moved here and | |
518 | deprecated. | |
519 | ||
520 | * threads.c: Include <errno.h>. Include "coop-pthreads.c" when | |
521 | requested. | |
522 | (scm_thread_exited_p): New. | |
523 | (scm_try_mutex, scm_broadcast_condition_variable): Newly | |
524 | registered procedures. | |
525 | (scm_wait_condition_variable, scm_timed_wait_condition_variable): | |
526 | Use the latter as the procedure for "wait-condition-variable", | |
527 | thus offering a optional timeout parameter to Scheme. | |
528 | (scm_wait_condition_variable): Implement in terms of | |
529 | scm_timed_wait_condition_variable. | |
530 | (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock, | |
531 | scm_mutex_unlock, scm_mutex_destroy, scm_cond_init, | |
532 | scm_cond_wait, scm_cond_timedwait, scm_cond_signal, | |
533 | scm_cond_broadcast, scm_cond_destroy): Implement in terms of | |
534 | scm_make_mutex, etc, and deprecate. | |
535 | (scm_init_threads): Do not create smobs, leave this to | |
536 | scm_threads_init. Do not include "threads.x" file. | |
537 | (scm_init_thread_procs): New, include "threads.x" here. | |
538 | ||
539 | * null-threads.h (scm_null_mutex, scm_null_mutex_init, | |
540 | scm_null_mutex_lock, scm_null_mutex_unlock, | |
541 | scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init, | |
542 | scm_null_condvar_wait, scm_null_condvar_signal, | |
543 | scm_null_condvar_destroy): Removed. | |
544 | (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init, | |
545 | scm_cond_wait, scm_cond_signal, scm_cond_broadcast, | |
546 | scm_cond_destory): Do not define, they are now deprecated and | |
547 | handled by threads.{h,c}. | |
548 | ||
549 | * null-threads.c (scm_null_mutex, scm_null_cond): Define here. | |
550 | (scm_threads_init): Create smobs here, using the appropriate | |
551 | sizes. | |
552 | (block): Removed, now unused. | |
553 | (scm_c_thread_exited_p): New. | |
554 | (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock, | |
555 | scm_null_mutex_destroy, scm_null_condvar_init, | |
556 | scm_null_condvar_wait, scm_null_condvar_signal, | |
557 | scm_null_condvar_destroy): Removed and updated users to do their | |
558 | task directly. | |
559 | (scm_try_mutex, timeval_subtract, | |
560 | scm_timed_wait_condition_variable, | |
561 | scm_broadcast_condition_variable): New. | |
562 | (scm_wait_condition_variable): Removed. | |
563 | ||
564 | * coop-defs.h (coop_m): Added 'level' field. | |
565 | (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock, | |
566 | scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init, | |
567 | scm_cond_wait, scm_cond_timedwait, scm_cond_signal, | |
568 | scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not | |
569 | define. | |
570 | (coop_condition_variable_broadcast): New. | |
571 | ||
572 | * coop-threads.c (scm_threads_init): Create smobs here, using the | |
573 | appropriate sizes. | |
574 | (scm_c_thread_exited_p, scm_try_mutex, | |
575 | scm_timed_wait_condition_variable, | |
576 | scm_broadcast_condition_variable): New. | |
577 | (scm_wait_condition_variable): Removed. | |
578 | ||
579 | * coop.c (coop_new_mutex_init): Initialize level. | |
580 | (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain | |
581 | level. | |
582 | (coop_condition_variable_signal): Renamed to | |
583 | coop_condition_variable_broadcast and reimplemented in terms of | |
584 | that. Thus... | |
585 | (coop_condition_variable_broadcast): New. | |
586 | ||
587 | * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc. | |
588 | ||
589 | * coop-pthreads.h, coop-pthreads.c: New, but unfinished. | |
590 | ||
087ed40d MV |
591 | 2002-10-21 Marius Vollmer <mvo@zagadka.ping.de> |
592 | ||
65a23095 MV |
593 | * null-threads.c: Include <time.h>. Also, use <...> for inclusion |
594 | of system headers. | |
595 | ||
087ed40d MV |
596 | * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG): |
597 | New. Use it instead of SCM_MAKE_VALIDATE in lots of places to | |
30f920c3 | 598 | give better error messages. Thanks to Bill Schottstaedt! |
087ed40d | 599 | |
5ec1d2c8 DH |
600 | 2002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de> |
601 | ||
602 | * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed | |
603 | scm_definedp to scm_defined_p and deprecated scm_definedp. | |
604 | ||
100ae50d DH |
605 | 2002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de> |
606 | ||
607 | * async.h, async.c (scm_system_async): Fixed deprecation to work | |
608 | correctly when deprecated features are excluded. | |
609 | ||
2794cb50 MV |
610 | 2002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de> |
611 | ||
612 | * async.c (scm_system_async_mark_for_thread): Validate thread | |
613 | argument. | |
614 | ||
615 | * coop-threads.c (scm_i_thread_root): Do not validate argument. | |
616 | ||
617 | * feature.c (scm_init_feature): Don't add 'threads' for | |
618 | USE_NULL_THREADS. | |
619 | ||
620 | * inline.h (scm_cell, scm_double_cell): Also allow | |
621 | USE_NULL_THREADS to not protect the slot initializers. | |
622 | ||
623 | * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not | |
624 | "USE_THREAD". | |
625 | ||
626 | * Makefile.am (noinst_HEADERS): Added null-threads.c. | |
627 | (modinclude_HEADERS): Added null-threads.h. | |
628 | ||
629 | * threads.h: Include null-threads.h when !USE_COOP_THREADS. | |
630 | * threads.c: Include null-threads.c when !USE_COOP_THREADS. | |
631 | (scm_init_threads): Use generic type names scm_t_mutex and | |
632 | scm_t_cond instead of coop_m and coop_c. | |
633 | ||
634 | * null-threads.c, null-threads.h: New files. | |
635 | ||
ff810d7a MV |
636 | 2002-10-15 Marius Vollmer <mvo@zagadka.ping.de> |
637 | ||
638 | * Makefile.am: Replaced "$<" in non-pattern rules with its value. | |
639 | This is to support makes that know about "$<" only in pattern | |
640 | rules, like Sun's make. | |
641 | ||
a90bdb73 MV |
642 | 2002-10-13 Marius Vollmer <mvo@zagadka.ping.de> |
643 | ||
644 | * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute | |
645 | substitution. Thanks to David Allouche! | |
646 | ||
e71a8bf2 DH |
647 | 2002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de> |
648 | ||
649 | * evalext.h: Replaced SCM_DEBUG_DEPRECATED with | |
650 | !SCM_ENABLE_DEPRECATED. | |
651 | ||
41f77ff5 MV |
652 | 2002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de> |
653 | ||
504d99c5 | 654 | * async.c (scm_system_async_mark_for_thread): Only call |
41f77ff5 MV |
655 | scm_i_thread_root when USE_THREADS is defined. Use scm_root |
656 | otherwise. | |
657 | ||
658 | * scmsigs.c (take_signal): Only call scm_i_thread_root when | |
659 | USE_THREADS is defined. Use scm_root otherwise. | |
660 | (scm_sigaction_for_thread): Ignore THREAD argument when | |
661 | USE_THREADS is not defined. Also, move THREAD argument defaulting | |
662 | out of HAVE_SIGACTION section, which was a bug. | |
663 | ||
6d16b125 MV |
664 | 2002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de> |
665 | ||
666 | * scmsigs.c (scm_sigaction_for_thread): Store original handler in | |
667 | signal_handlers, not the closure that is used as the async. | |
668 | The closure is stored in signal_handler_cells, as previously. | |
669 | ||
acfa1f52 MV |
670 | 2002-10-10 Marius Vollmer <mvo@zagadka.ping.de> |
671 | ||
672 | * root.h (scm_root_state): Added 'block_async' slot. | |
673 | (scm_active_asyncs): Removed abbrev. | |
674 | * root.c (scm_make_root): Initialize 'block_asyncs' slot. | |
675 | ||
676 | * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs | |
677 | abbrev. | |
678 | ||
679 | * async.h (scm_call_with_blocked_asyncs, | |
680 | scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs, | |
681 | scm_c_call_with_unblocked_asyncs): New prototypes. | |
682 | (scm_mask_signals, scm_unmask_signals): Deprecated. | |
683 | (scm_mask_ints): Turned into a macro. | |
684 | * async.c (scm_mask_ints): Removed. | |
685 | (scm_run_asyncs): Do not set scm_mask_ints while running an async. | |
686 | this should not be necessary. | |
687 | (scm_async_click): Test block_asyncs instead of scm_mask_ints. | |
688 | (scm_mask_signals, scm_unmask_signals): Deprecated. Emit | |
689 | deprecation warning and check for errornous use. Set block_asyncs | |
690 | instead of scm_mask_ints. | |
691 | (increase_block, decrease_block, scm_call_with_blocked_asyncs, | |
692 | scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs, | |
693 | scm_c_call_with_unblocked_asyncs): New. | |
694 | ||
695 | * script.c (scm_compile_shell_switches): Do not set scm_mask_ints. | |
696 | Asyncs are enabled by default. | |
697 | ||
34010f56 NJ |
698 | 2002-10-09 Neil Jerram <neil@ossau.uklinux.net> |
699 | ||
700 | * vports.c (scm_make_soft_port): Allow vector argument to carry a | |
701 | 6th element: an input waiting thunk. | |
702 | (sf_input_waiting): New. | |
703 | ||
9310d6f2 MV |
704 | 2002-10-05 Marius Vollmer <mvo@zagadka.ping.de> |
705 | ||
706 | * root.c (root_mark): Mark active_asyncs slot. | |
707 | ||
708 | * async.c (scm_async_click): Set the cdr of a executed handler | |
709 | cell to SCM_BOOL_F, not SCM_EOL. | |
710 | (scm_i_queue_async_cell): Queue the cell at the end of the list, | |
711 | and only if the handler procedure is not already present. | |
712 | (scm_system_async_mark_for_thread): Initialize cdr of handler cell | |
713 | with SCM_BOOL_F. | |
714 | * scmsigs.c (scm_sigaction_for_thread): Likewise. | |
715 | ||
ac48c719 RB |
716 | 2002-10-04 Rob Browning <rlb@defaultvalue.org> |
717 | ||
1360a142 RB |
718 | * guile.c (main): switch to scm_lt_dlset_preloaded_symbols; |
719 | ||
720 | * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle, | |
721 | scm_lt_dlopenext, and scm_lt_dlerror. | |
722 | (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose, | |
723 | and scm_lt_dlerror. | |
724 | (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym, | |
725 | and scm_lt_dlerror. | |
726 | (sysdep_dynl_init): switch to scm_lt_dlinit(); | |
727 | ||
728 | * Makefile.am (libguile_la_LIBADD): switch to use | |
729 | libguile-ltdl.la. | |
730 | ||
504d99c5 | 731 | * numbers.c (scm_integer_expt): (expt 0 1) should be 1. |
ac48c719 | 732 | |
497092c9 MV |
733 | 2002-10-04 Marius Vollmer <mvo@zagadka.ping.de> |
734 | ||
735 | * scmsigs.h (scm_sigaction_for_thread): New prototype. | |
736 | * scmsigs.c (got_signal): Removed. | |
737 | (signal_handler_cells, signal_handler_threads): New. | |
738 | (take_signal): Queue the cell of the signal for the specified | |
739 | thread. Reset the signal handler on systems that don't have | |
740 | sigaction. | |
741 | (sys_deliver_signals): Removed. | |
742 | (close_1): New. | |
743 | (scm_sigaction_for_thread): Renamed from scm_sigaction and | |
744 | extended to also set the thread of a signal and allocate a cell | |
745 | for it. Keep the Scheme name "sigaction". Check that signum is | |
746 | within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS. | |
747 | (scm_sigaction): Implement in terms of scm_sigaction_for_thread. | |
748 | (scm_init_scmsigs): Allocate signal_handler_cells and | |
749 | signal_handler_threads vectors. | |
750 | ||
751 | * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so | |
752 | that system asnycs and user asyncs are separated. Reimplemented | |
753 | system asyncs to work per-thread. | |
754 | ||
755 | * gc.c (scm_init_gc): Do not use scm_system_async. | |
756 | ||
757 | * async.h (scm_asyncs_pending, scm_set_tick_rate, | |
758 | scm_set_switch_rate, scm_system_async_mark_from_signal_handler): | |
759 | Removed prototypes. | |
760 | (scm_i_queue_async_cell): New. | |
761 | ||
762 | * __scm.h (scm_asyncs_pending_p): Removed. | |
763 | (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of | |
764 | scm_asyncs_pending_p. | |
765 | ||
766 | * async.h (scm_system_async_mark_for_thread): New prototype. | |
767 | ||
768 | * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code. | |
769 | ||
770 | * root.h (scm_root_state): Added new "active_asyncs" slot. | |
771 | * root.c (scm_make_root): Initialize it to SCM_EOL. | |
772 | ||
773 | * coop-defs.h (coop_t): Added new "handle" slot. | |
774 | * coop-threads.c (all_threads, scm_current_thread, | |
775 | scm_all_threads, scm_i_thread_root): New. | |
776 | (scm_threads_init): Add main thread to all_threads. | |
777 | (scheme_launch_thread): Remove thread from all_threads when it | |
778 | terminates. | |
779 | (scm_call_with_new_thread): Initialize handle slot of coop_t | |
780 | structure and add new thread to all_threads. | |
781 | (scm_spawn_thread): Likewise. | |
782 | ||
783 | * threads.h (scm_current_thread, scm_all_threads): New prototypes. | |
784 | * threads.c (scm_current_thread, scm_all_threads): Register as | |
785 | primitives. | |
786 | ||
787 | * dynl.c: Use scm_lt_ prefix for libltdl functions. | |
788 | ||
480fa28d NJ |
789 | 2002-09-29 Neil Jerram <neil@ossau.uklinux.net> |
790 | ||
791 | * script.c (scm_compile_shell_switches): Fix bad spelling of | |
792 | `explicitly' in comment. | |
793 | ||
794 | 2002-09-28 Neil Jerram <neil@ossau.uklinux.net> | |
795 | ||
796 | * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid): | |
797 | Refer to provided? in doc string rather than deprecated feature?. | |
798 | ||
3553e1d1 GH |
799 | 2002-09-24 Gary Houston <ghouston@arglist.com> |
800 | ||
801 | * inline.h (scm_double_cell): prevent reordering of statements | |
802 | with any following code (for GCC 3 strict-aliasing). | |
803 | * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed | |
804 | the earlier version of the reordering prevention. | |
805 | ||
4ad0814a HWN |
806 | 2002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl> |
807 | ||
808 | * inline.h (scm_double_cell): move SET_GCMARK set out of if body. | |
809 | ||
e88e4f2e HWN |
810 | 2002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl> |
811 | ||
812 | * gc-malloc.c (scm_gc_register_collectable_memory): more overflow | |
813 | protection. | |
814 | ||
1e71eafb HWN |
815 | 2002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl> |
816 | ||
817 | * inline.h: include stdio.h | |
818 | ||
819 | * smob.c (free_print): abort if scm_debug_cell_accesses_p is set | |
820 | ||
61ef9c1f HWN |
821 | 2002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl> |
822 | ||
dac04e9f HWN |
823 | * gc-segment.c (scm_i_make_initial_segment): check user settings |
824 | for sanity. | |
825 | ||
826 | * gc-malloc.c (scm_gc_init_malloc): check user settings for | |
827 | sanity. | |
dac04e9f HWN |
828 | |
829 | * gc-freelist.c (scm_init_freelist): check user settings for sanity. | |
830 | ||
ffd72400 HWN |
831 | * struct.h: change scm_structs_to_free to scm_i_structs_to_free |
832 | ||
833 | * gc-malloc.c (scm_gc_register_collectable_memory): use floats; | |
1e71eafb HWN |
834 | these won't ever wrap around with high memory usage. Thanks to |
835 | Sven Hartrumpf for finding this. | |
ffd72400 | 836 | |
5bd4a949 HWN |
837 | * gc-freelist.c: include <stdio.h> |
838 | ||
61ef9c1f HWN |
839 | * gc-malloc.c: add DEBUGINFO for mtrigger GCs. |
840 | ||
ffd0ef3b MV |
841 | 2002-09-01 Marius Vollmer <mvo@zagadka.ping.de> |
842 | ||
a27e3d14 MV |
843 | * vectors.h (SCM_VECTOR_REF): New. |
844 | ||
ffd0ef3b MV |
845 | * snarf.h (SCM_DEFINE_PUBLIC): New. |
846 | ||
f8a1712b MV |
847 | 2002-08-30 Marius Vollmer <mvo@zagadka.ping.de> |
848 | ||
849 | * socket.c (scm_addr_vector): Added size of address to arguments. | |
850 | Use it to avoid accessing a non-existent path in a sockaddr_un. | |
851 | Changed all callers. | |
852 | ||
7200a36b HWN |
853 | 2002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl> |
854 | ||
1383773b HWN |
855 | * gc.h: remove DOUBLECELL card flags. |
856 | ||
857 | * gc-malloc.c (scm_calloc): try to use calloc() before calling | |
858 | scm_realloc(). | |
859 | ||
860 | * gc-segment.c (scm_i_initialize_heap_segment_data): remove card | |
861 | init loop; handle this from scm_init_card_freelist() | |
862 | ||
863 | * gc-card.c (scm_init_card_freelist): init bit vector here. | |
864 | ||
7200a36b | 865 | * numbers.c (scm_make_real): prevent reordering of statements |
8fa5786d | 866 | num2float.i.c (FLOAT2NUM): idem |
7200a36b | 867 | |
9981de3a HWN |
868 | 2002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl> |
869 | ||
870 | * eval.h: prepend libguile/ to include path | |
871 | ||
19647556 MV |
872 | 2002-08-26 Marius Vollmer <mvo@zagadka.ping.de> |
873 | ||
874 | * script.c (scm_compile_shell_switches): Added "2002" to Copyright | |
875 |