Files
mercury/tests/par_conj/spawn_many.exp
Peter Wang 2fe0ca6abb Change the implementation of thread.spawn in low-level C grades.
Estimated hours taken: 10
Branches: main

Change the implementation of thread.spawn in low-level C grades.  Previously it
called the thread goal (a closure) via an exported Mercury procedure.  The
problem with that is the call counts as a C -> Mercury call, and so goes via
MR_call_engine() which sets up a large stack frame on the Mercury engine's C
stack that won't be deallocated until the thread terminates.

This is unnecessary inefficient since we can call the thread goal directly
instead of via MR_call_engine().  The thread goal won't be returning to a C
foreign proc when it finishes, and we don't need MR_call_engine() reserving
C stack space for Mercury execution as any Mercury engine that is about to
execute the thread goal would have that reserved space already.

library/thread.m:
	As above.

tests/par_conj/Mmakefile:
tests/par_conj/spawn_many.exp:
tests/par_conj/spawn_many.m:
	Add test case.
2007-04-30 06:49:21 +00:00

2 lines
3 B
Plaintext