Fuoco Multi-threading Programming Framework

Fuoco is a simple multi-threading programming framework for Yotsuba 3. This framework is to make multi-threading programming in Python even easier. The framework will block the caller thread until all data is processed.

At the current state of the development, there are known limitations:

  1. MultiThreadingFramework can only use one kind of the worker at a time.
  2. MultiThreadingFramework.run can not return anything. Global variables can be used to resolve this problem.
class yotsuba.core.mt.MultiThreadingFramework

Simple multi-threading framework for small tasks.

run(input, worker, common_args=None, max_thread=None)

Run multiple workers simulteneously (in multiple threads).

The parameter worker is a reference to a function that will be called by each thread.

The parameter input is the input list that will be feeded to the queue.

The parameter common_args is the common arguements for the worker.

The parameter max_thread is the maximum number of threads used in one run. (Optional, default: 4)

class yotsuba.core.mt.ThreadTermSignal

Terminating Signal only used by MultiThreadingFramework

exception yotsuba.core.mt.UnsupportedCommonArguments

Exception for unsupported common arguments

exception yotsuba.core.mt.UnsupportedInputList

Exception for unsupported input list

yotsuba.core.mt.sample_worker_function(data)

This is the sample worker function/method.

Requirements for the worker function/method:
  1. The first parameter must be something that stores the data from the queue.
  2. The worker never returns anything unless it is a new data that you want it to be processed in the current pool.

Warning

Any worker function used with Fuoco cannot return value that the moment. See Lesson 1: Multi-threading programming on the work-around solution.

Previous topic

File System API

Next topic

Graph API

This Page