Commit Graph

59 Commits

Author SHA1 Message Date
Araq
03550f14f8 createThread is more convenient to use with a proc taking no arguments 2015-10-19 16:09:35 +02:00
Reimer Behrends
639b5e0069 Properly register threads with the Boehm GC.
In order to be able to scan thread stacks, the Boehm GC needs to know
about newly created threads. We establish the end of the stack by using
GC_call_with_stack_base (this works properly also with the dual-stack
Itanium architecture) and then GC_register_my_thread() to register a
thrad and GC_unregister_my_thread() to unregister it again.

This patch also includes a modification for the refc and markandsweep
collectors to set the stack bottom for thread stacks correctly even if
an optimizer aggressively inlines and optimizes procedures (this is
already being done for the stack of the main thread).

Finally, we use the {.noconv.} pragma for the Boehm GC, as the Boehm
API uses no specific calling convention.
2015-09-08 19:01:06 +02:00
Araq
20c2b00822 make --gc:none work with --threads:on 2015-08-26 23:59:00 +02:00
Araq
70fe773bbe implemented system.pinToCpu 2015-07-01 02:15:22 +02:00
Sergey Avseyev
70ce8695e7 Fix #2672. Do not define globalsSlot for native TLS
Motivation
----------
globalsSlot is always defined so threading code works incorrectly when
native TLS supported.

Modification
------------
Defined globalsSlot only in TLS emulation mode. Remove myThreadId, which
based on broken behavior. It might be reimplemented later

Result
------
No segfaults.
2015-06-26 07:42:58 +03:00
Sergey Avseyev
f9d8d6ce09 Trim trailling spaces 2015-06-26 07:42:58 +03:00
Stefan Talpalaru
bdac85f2cf Merge branch 'devel' into gogc 2015-06-15 08:44:02 +02:00
pdw
2ca90a20a1 lib/system/g-w - Dropped 'T' from types 2015-06-04 13:18:37 +02:00
Stefan Talpalaru
50e96ad939 the Go GC - initial implementation 2015-05-31 19:07:44 +02:00
Philip Wernersbach
f8d6d74368 Fix pthread_create binding when compiling in C++ mode.
C++ has different rules for void pointers, which causes the binding
to be invalid when compiling in C++ mode.
2015-03-15 17:33:46 -04:00
Araq
3dd1ecbae4 fixes #2074 2015-02-26 02:05:23 +01:00
Hans Raaf
55ab6cc2b3 Disable -pthread for linker on OSX
The -pthread is not needed on Darwin/OS X and the Apple compilers give a
warning about this if you use --threads:on with the Nim compiler.
2015-02-13 01:51:46 +01:00
Araq
af84f754b0 proper fix for stack initialization and threadvar emulation 2014-11-11 09:55:31 +01:00
Reimer Behrends
c43e7c4ff6 Remove references to pthread_mutex_timedlock().
The pthread_mutex_timedlock() function is not supported on a number
of architectures and is not actually used by the library or compiler,
but prevents C++ compilation on systems that do not support it when
threads are enabled.
2014-11-06 02:23:40 +01:00
Araq
9d9c3fe121 merged things from devel 2014-09-12 01:37:48 +02:00
Araq
24afab2a95 Threads work again 2014-09-11 09:36:22 +02:00
Araq
30823c1ce3 make tests green 2014-08-31 15:15:26 +02:00
Dominik Picheta
8446d51a6a Winlean and threads case sensitivity fixes. 2014-08-30 12:57:04 +01:00
Araq
dbf9117c56 the big renamefest: first steps 2014-08-22 23:54:26 +02:00
Araq
dd806cafa0 distinguish between 'defined' and 'declared' 2014-08-11 20:38:28 +02:00
Araq
fab8cee13d minor tweaks; updated todo.txt 2014-04-25 19:54:42 +02:00
Araq
e6d17e6273 made large parts of the stdlib gcsafe 2014-04-20 20:01:24 +02:00
Araq
346443d1b5 case consistency improvements 2014-01-11 21:56:05 +01:00
Satish BD
033938a53a Correct the spelling of the word 'implicitly' 2013-12-23 04:29:50 +02:00
Araq
f59e502382 better error message for implicitly available modules 2013-12-01 14:04:15 +01:00
Grzegorz Adam Hankiewicz
2b517161e4 Adds link to manual thread memory section from threads module. 2013-05-10 23:33:01 +02:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Dominik Picheta
76c4b0516a Many doc improvements. Changed Threads.joinThreads' param's type to varargs. 2012-11-04 22:30:19 +00:00
Araq
8178cd4fab made some tests green 2012-09-12 08:43:24 +02:00
Araq
8a92e95ccf made tests green again 2012-08-24 19:08:34 +02:00
Araq
3c50794a08 keep initStackBottom calls please 2012-08-02 23:21:58 +02:00
Zahary Karadjov
1d065b601c DLL fixes for windows; fixes #175 2012-07-31 18:59:44 +03:00
Araq
035b715dfd fixes #168 2012-07-19 18:43:03 +02:00
Araq
8d99753d63 preparations for making 'closure' the default calling convention for proc types 2012-07-16 23:00:57 +02:00
Araq
4f1b89c30c year 2012 for most copyright headers 2012-01-02 23:07:35 +01:00
Araq
728328eec2 threads compile again; attempt to fix serious code gen issue (except + return) 2011-12-03 19:22:01 +01:00
Araq
7fcbdc6d42 implemented 'let' statement 2011-11-29 17:27:48 +01:00
Araq
02e8e9c3ea fixed bug that kept tls emulation from working 2011-11-25 17:26:11 +01:00
Araq
84c473a890 DLL generation may work again 2011-11-02 01:25:17 +01:00
Araq
5e5e4abfee new compiler option tlsEmulation 2011-10-27 21:03:53 +02:00
Araq
fd62116f6e bugfixes for generics; new threads implementation still broken 2011-09-20 00:56:48 +02:00
Araq
4839800c22 new actors implementation for nimrod; compiler's generics still not up for the task though 2011-08-29 01:14:26 +02:00
Araq
d560e84fcc locks now in their own core module 2011-08-20 00:24:02 +02:00
Araq
c6038dda04 bugfix: running for threads 2011-08-12 01:24:47 +02:00
Araq
7ad5cab17e added system.running for threads 2011-08-11 21:22:23 +02:00
Araq
569c1ce5ec bugfix: proper cache for generic instantiations 2011-07-21 00:57:39 +02:00
Araq
81a917390b shared untraced heap; bugfix: mem corruptions in message passing code 2011-07-18 23:59:39 +02:00
Araq
42e6130b2c first steps to explicit channels for thread communication; added mainThreadId 2011-07-16 18:34:18 +02:00
Araq
3ed1c958f3 version 0.8.12 2011-07-10 16:53:24 +02:00
Araq
5b96eaa953 preparations for 0.8.12 2011-07-10 15:48:13 +02:00