aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2010-06-12task: improved naming of task types, improved pool test to be less dependent ↵Sebastian Thiel
on starting with just the main thread
2010-06-12channel: cleaned up inheritance hierarchy, adding mixing for callback ↵Sebastian Thiel
functionality - previously the callback functionality was bound to channel based readers/writers
2010-06-12Cleaned up channel design, Reader and Writer bases don't require a channel ↵Sebastian Thiel
anymore, but are abstract. Added IteratorReader, implementing the reader interface from an iterator. The implementation moved from the TaskIterator to the channel
2010-06-11Added performance test, improved iterator task which will now be usable by ↵Sebastian Thiel
default. It shows that there must be the notion of a producer, which can work if there are no items read
2010-06-11test_task: fixed import error, made all modules from x import * safeSebastian Thiel
2010-06-11Removed commented-out debug code and additional debug printings. Verified it ↵Sebastian Thiel
works on py2.4, 2.5 and 2.6
2010-06-11Improved shutdown handling - although its impossible to prevent some stderr ↵Sebastian Thiel
printing thanks to the underlying threading implementation, we can at least make sure that the interpreter doesn't block during shutdown. Now it appears to be running smoothly
2010-06-11IMPORTANT: sometimes, when notifying waiters by releasing their lock, the ↵Sebastian Thiel
lock is not actually released or they are not actually notifyied, staying in a beautysleep. This glitch is probably caused by some detail not treated correctly in the thread python module, which is something we cannot fix. It works most of the time as expected though - maybe some cleanup is not done correctly which causes this
2010-06-10Added dependency-task tests, and fixed plenty of ref-count related bugs, as ↵Sebastian Thiel
well as concurrency issues. Now it works okay, but the thread-shutdown is still an issue, as it causes incorrect behaviour making the tests fail. Its good, as it hints at additional issues that need to be solved. There is just a little more left on the feature side, but its nearly there
2010-06-10tasks can now terminate faster when no items were read, without neglecting ↵Sebastian Thiel
their duty to close the channel if required. Code is a little less maintainable now, but faster, it appears
2010-06-10Now tracking the amount of concurrent writers to assure the channel is ↵Sebastian Thiel
closed only when there is no one else writing to it. This assures that all tasks can continue working, and put their results accordingly. Shutdown is still not working correctly, but that should be solvable as well. Its still not perfect though ...
2010-06-10channel: Changed design to be more logical - a channel now has any amount of ↵Sebastian Thiel
readers and writers, a ready is not connected to its writer anymore. This changes the refcounting of course, which is why the auto-cleanup for the pool is currently broken. The benefit of this are faster writes to the channel, reading didn't improve, refcounts should be clearer now
2010-06-10Added more dependency task tests, especially the single-reads are not yet ↵Sebastian Thiel
fully deterministic as tasks still run into the problem that they try to write into a closed channel, it was closed by one of their task-mates who didn't know someone else was still computing
2010-06-10InputChannelTask now has interface for properly handling the reading from ↵Sebastian Thiel
the same and different pools
2010-06-10messy first version of a properly working depth-first graph method, which ↵Sebastian Thiel
allows the pool to work as expected. Many more tests need to be added, and there still is a problem with shutdown as sometimes it won't kill all threads, mainly because the process came up with worker threads started, which cannot be
2010-06-09test: prepared task dependency test, which already helped to find bug in the ↵Sebastian Thiel
reference counting mechanism, causing references to the pool to be kepts via cycles
2010-06-09task: redesigned write channel access to allow the task creator to set own ↵Sebastian Thiel
write channels, possibly some with callbacks installed etc.. Pool.add_task will respect the users choice now, but provide defaults which are optimized for performance
2010-06-09Channel: Callbacks reviewed - they are now part of Subclasses of the default ↵Sebastian Thiel
channel implementation, one of which is used as base by the Pool Read channel, releasing it of the duty to call these itself. The write channel with callback subclass allows the transformation of the item to be written
2010-06-09task: removed scheduled task support, which at some point was introduced to ↵Sebastian Thiel
improve performance, but which now hinders performance, besides being unnecessary ;)
2010-06-09Channel: removed pseudoconstructor, which clearly improves the design and ↵Sebastian Thiel
makes it easier to constomize pool: in serial mode, created channels will be serial-only, which brings 15% of performance
2010-06-09Channel: Read method revised - now it really really doesn't block anymore, ↵Sebastian Thiel
and it runs faster as well, about 2/3 of the performance we have when being in serial mode
2010-06-09HSCondition: Fixed terrible bug which it inherited from its default python ↵Sebastian Thiel
Condition implementation, related to the notify method not being treadsafe. Although I was aware of it, I missed the first check which tests for the size - the result could be incorrect if the whole method wasn't locked. Testing runs stable now, allowing to move on \!
2010-06-09HSCondition: now gets a lock even in the single-notify case, as it was ↵Sebastian Thiel
required due to the non-atomiciy of the invovled operation. Removed one level of indirection for the lock, by refraining from calling my own 'wrapper' methods, which brought it back to the performance it had before the locking was introduced for the n==1 case
2010-06-09HSCondition: now deriving from deque, as the AsyncQeue does, to elimitate ↵Sebastian Thiel
one more level of indirection. Clearly this not good from a design standpoint, as a Condition is no Deque, but it helps speeding things up which is what this is about. Could make it a hidden class to indicate how 'special' it is
2010-06-09HSCondition: using a deck to store waiters, for further speedupSebastian Thiel
2010-06-09thread: fixed initialization problem if an empty iterable was handed inSebastian Thiel
queue: Queue now derives from deque directly, which safes one dict lookup as the queue does not need to be accessed through self anymore pool test improved to better verify threads are started correctly
2010-06-09queue: fixed critical bug in the notify method, as it was not at all ↵Sebastian Thiel
thread-safe, causing locks to be released multiple times. Now it runs very fast, and very stable apparently. Now its about putting previous features back in, and studying their results, before more complex task graphs can be examined
2010-06-08workerthread: adjusted to use a blocking queue, it will receive termination ↵Sebastian Thiel
events only with its queue, with boosts performance into brigt green levels
2010-06-08Revised task deletion works well, adjusted test to be creating new tasks all ↵Sebastian Thiel
the time instead of reusing its own one, it was somewhat hard to manage its state over time and could cause bugs. It works okay, but it occasionally hangs, it appears to be an empty queue, have to gradually put certain things back in, although in the current mode of operation, it should never have empty queues from the pool to the user
2010-06-08task: now deletes itself once its done - for the test this doesn't change a ↵Sebastian Thiel
thing as the task deletes itself too late - its time for a paradigm change, the task should be deleted with its RPoolChannel or explicitly by the user. The test needs to adapt, and shouldn't assume anything unless the RPoolChannel is gone
2010-06-08Its getting better already - intermediate commit before further chaning the ↵Sebastian Thiel
task class
2010-06-08queue: adjusted queue to be closable ( without own testing yet, except for ↵Sebastian Thiel
the pool which runs it ) - its not yet stable, but should be solvable.
2010-06-08The new channeldesign actually works, but it also shows that its located at ↵Sebastian Thiel
the wrong spot. The channel is nothing more than an adapter allowing to read multiple items from a thread-safe queue, the queue itself though must be 'closable' for writing, or needs something like a writable flag.
2010-06-08both versions of the async queue still have trouble in certain situations, ↵Sebastian Thiel
at least with my totally overwritten version of the condition - the previous one was somewhat more stable it seems. Nonetheless, this is the fastest version so far
2010-06-08test implementation of async-queue with everything stripped from it that ↵Sebastian Thiel
didn't seem necessary - its a failure, something is wrong - performance not much better than the original one, its depending on the condition performance actually, which I don't get faster
2010-06-07Task scheduled items lock now uses a dummy lock in serial mode, improving ↵Sebastian Thiel
its performance considerably. Channels now use the AsyncQueue, boosting their throughput to about 5k items / s - this is something one can work with, considering the runtime of each item should be large enough to keep the threads busy. This could be a basis, further testing needed
2010-06-07Channel now uses the AsyncQueue, boosting performance by factor 4, its a startSebastian Thiel
2010-06-07introduced a new counter keeping track of the scheduled tasks - this prevent ↵Sebastian Thiel
unnecessary tasks to be scheduled as we keep track of how many items will be produced for the task at hand. This introduces additional locking, but performns well in multithreaded mode. Performance of the master queue is still a huge issue, its currently the limiting factor, as bypassing the master queue in serial moode gives 15x performance, wich is what I would need
2010-06-07improved testing to test the actual async handling of the pool. there are ↵Sebastian Thiel
still inconsistencies that need to be fixed, but it already improved, especially the 4-thread performance which now is as fast as the dual-threaded performance
2010-06-07task: Fixed incorrect handling of channel closure. Performance is alright ↵Sebastian Thiel
for up to 2 threads, but 4 are killing the queue
2010-06-07Moved pool utilities into util module, fixed critical issue that caused ↵Sebastian Thiel
havok - lets call this a safe-state
2010-06-07added high-speed locking facilities, allowing our Queue to be faster, at ↵Sebastian Thiel
least in tests, and with multiple threads. There is still an sync bug in regard to closed channels to be fixed, as the Task.set_done handling is incorrecft
2010-06-07Added task order cache, and a lock to prevent us walking the graph while ↵Sebastian Thiel
changing tasks Now processing more items to test performance, in dual-threaded mode as well, and its rather bad, have to figure out the reason for this, probably gil, but queues could help
2010-06-07changed scheduling and chunksize calculation in respect to the ↵Sebastian Thiel
task.min_count, to fix theoretical option for a deadlock in serial mode, and unnecessary blocking in async mode
2010-06-07pool.consumed_tasks: is now a queue to be thread safe, in preparation for ↵Sebastian Thiel
multiple connected pools Reduced waiting time in tests to make them complete faster
2010-06-07pool: First version which works as expected in async mode. Its just using a ↵Sebastian Thiel
single task for now, but next up are dependent tasks
2010-06-06channel.read: enhanced to be sure we don't run into non-atomicity issues ↵Sebastian Thiel
related to our channel closed flag, which is the only way not to block forever on read(0) channels which were closed by a thread 'in the meanwhile'
2010-06-06Plenty of fixes in the chunking routine, made possible by a serialized ↵Sebastian Thiel
chunking test. Next up, actual async processing
2010-06-06First step of testing the pool - tasks have been separated into a new module ↵Sebastian Thiel
including own tests, their design improved to prepare them for some specifics that would be needed for multiprocessing support
2010-06-06thread: adjusted worker thread not to provide an output queue anymore - this ↵Sebastian Thiel
is handled by the task system graph: implemented it including test according to the pools requirements pool: implemented set_pool_size