Lecture Notes for CS 509, Advanced Programming II

3 March 2004 - Thread Iterators


To understand what *++ti does, break it up. ++ti creates a new thread and returns an iterator to it; *++it follows the new-thread iterator and returns the new thread's id.

Given C++ precidence rules, *ti++ is parenthesized as *(ti++). ti++ creates a new thread and returns the iterator to what was the most recently created thread (that is, it returns ti). *ti++ returns the id what was the most recently created thread.


This page last modified on 12 March 2004.