- 04 Oct, 2019 2 commits
-
-
Kirill Smelkov authored
In preparation to start migrating, at least partly, time functionality to nogil mode, move the code from time.py to _time.pyx . This is straight code movement except now -> pynow, and sleep -> pysleep replaces, since in _time.pyx now and sleep were already referring to nogil versions. We don't move just to time.pyx (note no _ prefix), since we will need to continue distinguishing pyx/nogil from py objects/functions, e.g. pyx time.second is C constant, while pyx time.pysecond is pyobject exported to python world as time.second.
-
Kirill Smelkov authored
Similarly to 78d85cdc (sync: threading.Event -> chan) replace everywhere threaing.Lock usage with sync.Mutex . This brings 2 goods: - sync.Mutex becomes more well tested; - we untie ourselves from threading python module (threading.Lock was the last user).
-
- 29 Aug, 2019 1 commit
-
-
Kirill Smelkov authored
- Add sleep functionality to libgolang runtime; - Implement sleep for thread and gevent runtimes. Thread runtime implements sleep independently of GIL, but only for POSIX for now; - Switch golang.time py module into using golang.time pyx module. As we are adding sleep, related functionality to query system about "what is current time?" is also added.
-
- 16 May, 2019 1 commit
-
-
Kirill Smelkov authored
Add time.Timer, time.Ticker and convenience functions time.tick, time.after and time.after_func. These will be used in context to support deadlines and timeouts. While at time topic, also provide sleep and now from golang.time, so that there is no need to import both golang.time and stdlib's time in a file. Provide time constants in the module as they are useful to have and mirror constants provided by Go's time. Note: timers implementation is very suboptimal for now.
-