Commit Graph

31 Commits

Author SHA1 Message Date
rdb ed5e5386b9 AsyncFuture improvements, incl. support for gathering futures 2017-12-21 14:07:01 +01:00
rdb 2e20a0f16e Implement awaitable thread-safe future for async operations
This introduces AsyncFuture as a new base class of AsyncTask.  It's modelled after asyncio's Future class, except that it is thread-safe and you can use result() to block the current thread waiting for the future to finish (of course this is not necessary for use with coroutines).

AsyncFuture should be used for any operation that finishes in the future, to get the benefit of awaitability within coroutines as well as a standard interface for querying status and results of the operation as well as cancelling it.  As such, it's been implemented in various places, including texture.prepare() and win.trigger_copy().

Note that AsyncFuture is intended to be used *once*; it cannot be used more than once.  As an example of how this works, tex.prepare() will return the same future as long as the prepare isn't complete, but when it is done, subsequent calls to tex.prepare() will return a new future.
2017-12-04 22:25:28 +01:00
rdb 0c0f9adab9 Support coroutines and async/await in the task manager and loader 2017-10-31 18:56:41 +01:00
rdb 47388b0dbc Separate out CPython calls from core libs; eliminate need for pystub 2016-07-20 14:30:41 +02:00
tobspr 0fcfb8e372 New file headers, new comment style 2016-02-17 17:47:48 +01:00
rdb bdf91e206d Remove references to Python.h and py_config.h from Panda headers, to prevent picking up a dependency on Python libraries in third-party modules 2015-11-28 16:33:44 +01:00
David Rose 2494b49728 Thread::get_current_task() 2010-02-09 20:14:58 +00:00
David Rose 02d94cc8d2 recalcWakeTime() 2008-10-31 05:02:57 +00:00
David Rose 8e68eb1dcd is_alive() 2008-10-22 19:12:33 +00:00
David Rose 02d98e41c7 friendlier interface for task management 2008-10-14 02:17:38 +00:00
David Rose 3bd5914b57 upon_birth race condition issues 2008-10-13 18:24:18 +00:00
David Rose bc2dcf0410 add get_name_prefix 2008-10-11 15:29:51 +00:00
David Rose 7683d94100 add TaskManager- events 2008-10-11 14:49:10 +00:00
David Rose bca1533952 interrupt should not stop task 2008-10-10 21:30:11 +00:00
David Rose a6a4a893d0 Task.sequence() 2008-10-05 00:24:55 +00:00
David Rose 4beba6ca6f integrate pview with new task manager 2008-10-03 20:30:07 +00:00
David Rose 7cca74a597 task.frame 2008-10-03 04:30:32 +00:00
David Rose a74bf92e67 combine DS_again with DS_restart 2008-09-29 18:37:10 +00:00
David Rose 2266110083 AsyncTask::is_runnable 2008-09-29 05:59:41 +00:00
David Rose c59bfe5459 more threading issues 2008-09-28 21:32:11 +00:00
David Rose 8bb89607ab DS_pickup 2008-09-27 15:56:50 +00:00
David Rose fd1218b07b task generators 2008-09-27 12:33:47 +00:00
David Rose 7e217b8bdc handle more exotic uses of taskMgr 2008-09-26 23:42:22 +00:00
David Rose e8587e4144 pstats 2008-09-25 23:59:55 +00:00
David Rose 306873b3ac task output 2008-09-25 23:20:59 +00:00
David Rose bf86abd1c5 task chains 2008-09-25 19:39:19 +00:00
David Rose 524128b9fd wip: starting experimental C-based task manager 2008-09-19 00:58:04 +00:00
David Rose fb9c56432a we are now using the modified BSD license 2008-05-28 18:37:20 +00:00
David Rose 4c2659988f minor threading fixes 2007-11-27 01:18:35 +00:00
Zachary Pavlov 220d33e006 okay, this is going to be a big commit. The basic idea here is to add transparent defines to allow for directory based dlls later. This will let us build tau again. ugggg 2007-07-20 23:02:51 +00:00
David Rose 3fe0ad1080 AsyncTaskManager, threaded sound loader 2006-08-29 19:27:03 +00:00