From 7b72d418ecebbbc57bf344ef52673c793e054a7f Mon Sep 17 00:00:00 2001 From: Kirill Smelkov Date: Wed, 26 Jan 2022 18:57:58 +0300 Subject: [PATCH] pygolang v0.1 --- CHANGELOG.rst | 34 +++++++++++++++++++++++++++++- README.rst | 7 ++++++ golang/__init__.py | 4 ++-- golang/_context.pyx | 4 ++-- golang/runtime/_runtime_thread.pyx | 2 +- 5 files changed, 45 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ae24bd0..7c3bc95 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,38 @@ Pygolang change history ----------------------- +0.1 (2022-01-26) +~~~~~~~~~~~~~~~~ + +- Add `os.signal` package that provides signal handing via nogil channels. This + allows to build concurrent systems without limitation of Python's standard + `signal` module: signal delivery is not delayed, potentially indefinitely, if + main thread is blocked or is busy doing any non-Python work (`commit 1`__, 2__, 3__, `example usage`__). + + __ https://lab.nexedi.com/nexedi/pygolang/commit/1fad944d + __ https://lab.nexedi.com/nexedi/pygolang/commit/ce507f4e + __ https://lab.nexedi.com/nexedi/pygolang/commit/e18adbab + __ https://lab.nexedi.com/nexedi/nxdtest/merge_requests/16 + +- Add C++ API for IO. (`commit 1`__, 2__, 3__, 4__, 5__, 6__). + + __ https://lab.nexedi.com/nexedi/pygolang/commit/3a838d24 + __ https://lab.nexedi.com/nexedi/pygolang/commit/3a131a51 + __ https://lab.nexedi.com/nexedi/pygolang/commit/c2471014 + __ https://lab.nexedi.com/nexedi/pygolang/commit/d358fa75 + __ https://lab.nexedi.com/nexedi/pygolang/commit/4690460b + __ https://lab.nexedi.com/nexedi/pygolang/commit/2a35ef5b + +- Fix segmentation-fault crashes on unhandled panic with gevent backend (commit__, `greenlet bug`__). + + __ https://lab.nexedi.com/nexedi/pygolang/commit/07cae4e9 + __ https://github.com/python-greenlet/greenlet/pull/285 + +- Fix `print(qq(ยท))` crash on Python2 (commit__). + + __ https://lab.nexedi.com/nexedi/pygolang/commit/08dc5d10 + + 0.0.9 (2021-12-08) ~~~~~~~~~~~~~~~~~~ @@ -21,7 +53,7 @@ Pygolang change history __ https://lab.nexedi.com/nexedi/pygolang/commit/78b4b41c - More fixes for `gpython` to be compatible with CPython in how it handles - program on stdin, interactive session and __main__ module setup (`commit 1`__, 2__, 3__, 4__, 5__). + program on stdin, interactive session and `__main__` module setup (`commit 1`__, 2__, 3__, 4__, 5__). __ https://lab.nexedi.com/nexedi/pygolang/commit/6cc4bf32 __ https://lab.nexedi.com/nexedi/pygolang/commit/22fb559a diff --git a/README.rst b/README.rst index 2063418..8d5e3f0 100644 --- a/README.rst +++ b/README.rst @@ -445,6 +445,13 @@ handle concurrency in structured ways: __ https://lab.nexedi.com/nexedi/pygolang/tree/master/golang/time.py __ https://lab.nexedi.com/nexedi/pygolang/tree/master/golang/_time.pxd +- |golang.os.signal|_ (py__, pyx__) provides signal handling via channels. + + .. |golang.os.signal| replace:: `golang.os.signal` + .. _golang.os.signal: https://lab.nexedi.com/nexedi/pygolang/tree/master/golang/os/signal.h + __ https://lab.nexedi.com/nexedi/pygolang/tree/master/golang/os/signal.py + __ https://lab.nexedi.com/nexedi/pygolang/tree/master/golang/os/_signal.pxd + .. [*] See `Go Concurrency Patterns: Context`__ for overview. diff --git a/golang/__init__.py b/golang/__init__.py index a1fef6d..6ca01c7 100644 --- a/golang/__init__.py +++ b/golang/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2018-2020 Nexedi SA and Contributors. +# Copyright (C) 2018-2022 Nexedi SA and Contributors. # Kirill Smelkov # # This program is free software: you can Use, Study, Modify and Redistribute @@ -33,7 +33,7 @@ See also package golang.pyx which provides similar functionality for Cython nogi from __future__ import print_function, absolute_import -__version__ = "0.0.9" +__version__ = "0.1" __all__ = ['go', 'chan', 'select', 'default', 'nilchan', 'defer', 'panic', 'recover', 'func', 'error', 'b', 'u', 'gimport'] diff --git a/golang/_context.pyx b/golang/_context.pyx index ecb1fa9..aa8bd4b 100644 --- a/golang/_context.pyx +++ b/golang/_context.pyx @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # cython: language_level=2 -# Copyright (C) 2019-2020 Nexedi SA and Contributors. +# Copyright (C) 2019-2022 Nexedi SA and Contributors. # Kirill Smelkov # # This program is free software: you can Use, Study, Modify and Redistribute @@ -32,7 +32,7 @@ from cpython cimport PyObject, Py_INCREF, Py_DECREF from libcpp.cast cimport static_cast, dynamic_cast -# _frompyx indicates that a constructur is called from pyx code +# _frompyx indicates that a constructor is called from pyx code cdef object _frompyx = object() # _newPyCtx creates new PyContext wrapping ctx. diff --git a/golang/runtime/_runtime_thread.pyx b/golang/runtime/_runtime_thread.pyx index 86ec2f8..288de3d 100644 --- a/golang/runtime/_runtime_thread.pyx +++ b/golang/runtime/_runtime_thread.pyx @@ -27,7 +27,7 @@ from __future__ import print_function, absolute_import # # On POSIX, for example, Python uses sem_init(process-private) + sem_post/sem_wait. # -# Similarly PyThread_start_new_thread - Python's C function function to create +# Similarly PyThread_start_new_thread - Python's C function to create # new thread - does not depend on GIL. On POSIX, for example, it is small # wrapper around pthread_create. # -- 2.25.1