diff options
Diffstat (limited to 'func')
| -rw-r--r-- | func/overlord/forkbomb.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/func/overlord/forkbomb.py b/func/overlord/forkbomb.py index 8d7fb31..1ff529d 100644 --- a/func/overlord/forkbomb.py +++ b/func/overlord/forkbomb.py @@ -72,6 +72,7 @@ def __bucketize(pool, slots): """ buckets = {} count = 0 + # print "DEBUG: slots: %s" % slots for key in pool: count = count + 1 slot = count % slots @@ -129,9 +130,13 @@ def batch_run(pool,callback,nforks=DEFAULT_FORKS,cachedir=DEFAULT_CACHE_DIR): the workload over nfork forks. Temporary files used during the operation will be created in cachedir and subsequently deleted. """ + if nforks <= 1: + # modulus voodoo gets crazy otherwise and bad things happen + nforks = 2 shelf_file = __get_storage("~/.func") __access_buckets(shelf_file,True,None) buckets = __bucketize(pool, nforks) + # print "DEBUG: buckets: %s" % buckets __forkbomb(1,buckets,callback,shelf_file) rc = __access_buckets(shelf_file,False,None) os.remove(shelf_file) |
