Commit Graph

114 Commits

Author SHA1 Message Date
Andreas Rumpf
7f377da1d2 fixes #14370 (#14371) 2020-05-16 17:03:25 +02:00
Andreas Rumpf
06dfd31612 fixes #13881
* fixes #13881
* documented changed requirements for system.onThreadDestruction
* destructors.rst: update the documentation
2020-05-12 15:46:24 +02:00
Andreas Rumpf
15ba765ebd enable --tlsEmulation:on for --gc:arc (#13685)
* enable --tlsEmulation:on for --gc:arc
* make -d:useMalloc work with --gc:arc --threads:on
2020-03-18 23:52:49 +01:00
Hiroki Noda
3ab1274231 Thread attributes should be destroyed using the pthread_attr_destroy() (#13293)
On some OSes (such as FreeBSD or Solaris), pthread_attr_init allocate
memory. So it is necessary to deallocate that memory by using
pthread_attr_destroy.
2020-01-29 17:33:21 +01:00
Mamy Ratsimbazafy
1f7871ea1c csize_t changes: pinToCpu didn't compile (#12725) 2019-11-25 08:42:19 +01:00
Andreas Rumpf
1746da2d9e --gc:destructors now means Nim uses pure refcounting (#12557) 2019-10-30 16:15:17 +01:00
Araq
bebda3851f fixes #1188 2019-08-16 13:29:58 +02:00
Arne Döring
803406d07c fix #11854 (#11857) 2019-07-30 17:24:42 +02:00
Dankr4d
9d536b90c1 Fixed "is not GC-safe as it calls 'createThread'" when creating a thread in a thread. (#11390) 2019-06-03 17:13:21 +02:00
Zed
3b4952da94 Fix header inconsistencies in documentation (#11071) 2019-04-23 08:40:20 +02:00
Araq
228d53006a refactoring: move threadlocalstorage into its own file 2019-04-04 16:35:15 +02:00
Andreas Rumpf
e263702688 --newruntime: progress 2019-03-14 19:53:27 +01:00
Miran
ca7980f301 improved documentation for several modules (#10752)
More detailed documentation for:
* md5
* hashes

Mostly cosmetic improvements for:
* threadpool
* typetraits
* channels
* threads
2019-03-01 12:57:55 +01:00
Andreas Rumpf
0036014727 system refactorings (#10559)
* move IO subsystem into its own module; refs #10385
* make standalone test compile again
* make C++ examples compile again
* make more tests green
* make sysAssert and gcAssert work again
2019-02-06 21:00:00 +01:00
Araq
3f6168b337 removes deprecated T/P types 2018-11-16 13:27:56 +01:00
Araq
64517445ea even more strict isNil handling for strings/seqs in order to detect bugs 2018-08-22 12:35:46 +02:00
alaviss
7ef268274f Haiku support for Nim (#8542)
* posix_other: Haiku now has spawn.h

This is added per https://dev.haiku-os.org/ticket/13446

* posix_other: Add Haiku specific Dirent members

* cpuinfo: Add an implementation for Haiku

* distros: Add basic Haiku support

* encodings: update Haiku support

* fenv, math: Haiku now provides libm

* times: Add Haiku struct members

* ansi_c, osalloc: Add Haiku constants

* threads: Add Haiku support

* testament: Haiku uses LIBRARY_PATH

* nim.cfg: Update Haiku support

libnetwork should only be linked if network functions are used

* threads: Haiku does not support -pthread switch

* tworkingdir: Haiku's env is in /bin

* posix_other: add SIGKILLTHR for Haiku

* sockets: link with libnetwork on Haiku

* coro: correct ucontext.h location

http://pubs.opengroup.org/onlinepubs/009696699/basedefs/ucontext.h.html

* coro: ucontext backend is not available on Haiku

Haiku doesn't provide the <ucontext.h> header, as it was removed from POSIX

* coro: fix setjmp backend

The compiler does not allow statements after a noreturn function

* nativesockets: Haiku doesn't support AI_V4MAPPED

* system: hostOS can contains "haiku"

* os: add support for Haiku's packagefs

packagefs is read-only, but there are writable holes to the underlying
file system as well

* os: update constant for Haiku
2018-08-14 09:35:07 +02:00
Joey
559a7615ad Nintendo switch support (#8069)
* Add config section for Nintendo Switch
* Add compiler configuration for Nintendo Switch and it's CPU
* Add specific lib code for Nintendo Switch
* Add GC support for Nintendo Switch
* Update changelog for Nintendo Switch
* Update changelog with more info about fixed paths
* Cleaned up GC memory management a bit
* Relocate docs for Switch
* Rename aarch64NoneElfGcc to nintendoSwitchGCC
* Remove armv8a57
* Fix installer.ini
* Reuse code in linux and amd64
* Add posix defs for nintendo switch
* Add more defined sections for nintendo switch
* Remove old comment
* Add what's not supported for Nintendo Switch docs
* Make nintendoswitch == posix
* Remove DEVKITPRO references from nim.cfg
* Make PR extccomp changes
* Remove Result type alias
* Add separate switch consts file
* Update docs for nintendo switch
* Fix travis errors with undefined consts and add correct wait.h procs
2018-06-27 12:35:09 +02:00
Emery Hemingway
22f714585b Native access to Genode environment
Add a 'GenodeEnv' type and a 'componentConstructHook' to the system
module. The 'componentConstructHook' allows for detection of POSIX style
programs that exit implicitly or native Genode components that
initialize to serve RPC requests and OS signals.

This hook takes a 'GenodeEnv' argument so that the environment interface
is passed cleanly to application code after globals are initialized.
This is an typed pointer to a C++ object, procedures for accessing the
environment will be available from a Nimble library and not included in
the standard library.

The standard library has an internal pointer to the environment object
but this is not for external use, the undocumented global environment
pointer has been removed.
2018-06-07 07:21:20 +02:00
Yuriy Glukhov
395b7506cf Expose GC_setStackBottom (#7885) 2018-06-04 11:12:18 +02:00
Jacek Sieka
4d6456d029 __NR_gettid as const on amd64 (#7460) 2018-04-06 10:07:36 +02:00
Araq
dc7a69cb66 Threading: increase TLS size for new allocator 2017-12-07 13:15:00 +01:00
Araq
b219fc74ad fixes #5143 2017-10-16 12:45:43 +02:00
Emery Hemingway
9258672cee balance Genode CPU pinning, deadlock at Genode exit (#6317)
* Genode: balance thread CPU affinities
Genode threads are pinned by defaut to the same CPU as the initial
component entrypoint thread. Thread affinities are also permanent. This
patch pins new threads to CPUs in a round-robin manner. Arbitrary CPU
pinning is not exposed and the 'nimPinToCpu' has no effect.

* Genode: guarantee that 'quit' will not return
On Genode exits are handled by whatever component is acting as parent.
The caller has no guarentee that the parent implementation will halt the
caller's threads, so explicitly deadlock the 'quit' procedure.
2017-09-16 08:02:59 +02:00
Araq
6b3af6a5d7 WIP: --gc:regions instead of --gc:stack 2017-08-13 02:51:00 +02:00
Ruslan Mustakov
03fc7f3941 Allow to configure tls size (#6171) 2017-08-05 16:34:31 +02:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Eugene Kabanov
3c36aed100 Cache threadId to not perform syscalls all the time (#6111)
Use syscall to get threadId on FreeBSD and MacOS
2017-07-16 17:01:58 +02:00
Eugene Kabanov
199f061ddc Fix #5920 (#5922)
* Use native `getthrid` on OpenBSD.
* Use NetBSD specific primitive to get thread id
2017-05-31 21:00:16 +02:00
Jacek Sieka
e512358bc9 Linux abi take 3 (#5692)
* avoid generating object fields for imported types
* fix some abi/type issues for linux_amd64
2017-04-12 22:57:10 +02:00
Emery Hemingway
dd7ebb2c95 fixup! support for the Genode OS framework (#5653)
Allocate thread metadata at createThread.
2017-04-02 23:48:23 +02:00
Emery Hemingway
7e351fc7fa support for the Genode OS framework (#5560) 2017-03-31 23:13:06 +02:00
Eugene Kabanov
254fbcc548 Fixes #4719. (#5585) 2017-03-23 16:13:38 +01:00
Eugene Kabanov
e20af5cec6 Fix #4972. (#5567) 2017-03-19 07:16:13 +01:00
Eugene Kabanov
336a7c9b3f Fixes to support Dragonfly BSD. (#5552)
* Fix kqueue.nim and ansi_c.nim to support dragonfly.
* Fix ioselectors.nim, threads.nim to support dragonfly.
* Fix deprecated dealloc call in tioselectors.nim.
* Fix tfsmonitor.nim test to run only on Linux.
* Fix osproc.nim return wrong exit codes.
* Fix getAppFilename() for dragonfly.
* Fix proper exit code handling.
2017-03-17 08:22:11 +01:00
Araq
4f062c3be0 removed onThreadCreation; onThreadDestruction is now thread local 2017-02-26 20:42:19 +01:00
Anatoly Galiulin
6fa1dba515 Add `tearDownForeignThreadGc` function (#5369) 2017-02-13 13:37:20 +01:00
Yuriy Glukhov
3978845266 Use __NR_gettid instead of SYS_gettid (#5338) 2017-02-04 21:18:54 +01:00
Andreas Rumpf
d12a5a6525 make getThreadId() work on OSX 2017-01-31 16:06:37 +01:00
araq
bd580e9d6e another attempt to getThreadId work on Linux 2017-01-31 15:44:11 +01:00
araq
eaa0eda72d make getThreadId() work on Linux 2017-01-31 13:49:32 +01:00
Araq
b173499543 added system.getThreadId for various OSes (untested) 2017-01-31 13:06:19 +01:00
Andreas Rumpf
f7e3addb89 bugfix: onThreadDestruction callbacks should be run in reverse order 2017-01-26 11:28:25 +01:00
Andreas Rumpf
eb96eaa5c2 onThreadDestruction feature added to Nim's threading model 2017-01-24 12:07:44 +01:00
Araq
572fd067cf added system.runOnThreadCreationHandlers for initialization of thread local storage for the main thread 2017-01-20 20:32:41 +01:00
Andreas Rumpf
61937974e2 added system.onThreadCreation feature for safe thread local storage initializations 2017-01-18 13:41:55 +01:00
Fabian Keller
5f6f444d55 naive work-around for time redefinition (#5193) 2017-01-08 17:53:43 +01:00
Andreas Rumpf
a93ca14418 disable pinToCpu for OSX 2017-01-07 13:27:16 +01:00
Andreas Rumpf
bc53d2c9de bugfix: bottom of AVL tree is now threadsafe 2016-09-24 02:27:12 +02:00
Andreas Rumpf
03768e7da0 attempt to fix #4640 2016-09-13 16:33:43 +02:00