Skip to Main Content
Intel Threading Building Blocks
book

Intel Threading Building Blocks

by James Reinders
July 2007
Intermediate to advanced content levelIntermediate to advanced
332 pages
10h 4m
English
O'Reilly Media, Inc.
Content preview from Intel Threading Building Blocks

Name

task_list Class — List of task objects.

Synopsis

#include "tbb/task.h"

class task_list;

Description

A task_list is a list of references to task objects. The purpose of task_list is to allow a task to create a list of child tasks and spawn them all at once via the method task:: spawn(task_list&). A task can belong to, at most, one task_list at a time, and can be on that task_list once at most. A task that has been spawned but has not started running must not belong to a task_list. A task_list cannot be copy-constructed or assigned.

Members

	namespace tbb {
	   class task_list {
	    public:
	        task_list();
	        ~task_list();
	        bool empty() const;
	        void push_back( task& task );
	        task& pop_front();
	        void clear();
	    };
	}
task_list()

Effects: constructs an empty list.

~task_list()

Effects: destroys the list. Does not destroy the task objects.

bool empty()const

Returns: true if the list is empty; false otherwise.

push_back(task& task)

Effects: inserts a reference to task at the back of the list.

task& task pop_front()

Effects: removes a task reference from the front of the list.

Returns: the reference that was removed.

void clear()

Effects: removes all task references from the list. Does not destroy the task objects.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Intel® Xeon Phi™ Coprocessor Architecture and Tools: The Guide for Application Developers

Intel® Xeon Phi™ Coprocessor Architecture and Tools: The Guide for Application Developers

Rezaur Rahman

Publisher Resources

ISBN: 9780596514808Errata Page