icetCreateContext(3)

NAME
icetCreateContext - creates a new context.

SYNOPSIS
#include <GL/ice-t.h>

IceTContext icetCreateContext(IceTCommunicator comm);

DESCRIPTION
The icetCreateContext creates a new context, makes it current, and returns a handle to the new context.

Like OpenGL, the ICE-T engine behaves like a large state machine. The parameters for engine operation is held in the current state. The entire state is encapsulated in a context. Each new context contains its own copy of the state.

It is therefore possible to change the entire current state of ICE-T by simply switch contexts. Switching contexts is much faster than trying to change many state parameters.

ERRORS
None

WARNINGS
None

BUGS
It may be tempting to use contexts to run different ICE-T operations on separate program threads. Although certainly possible, great care must be taken. First of all, all threads will share the same context. Second of all, ICE-T is not thread safe. Therefore, a multi-threaded program would have to run all ICE-T commands in `critical sections' to ensure that the correct context is being used, and the methods execute safely in general.

NOTES
icetCreateContext duplicates the communicator comm. Thus, to avoid deadlocks on certain implementations (such as MPI), the user level program should call icetCreateContext on all processes with the same comm object at about the same time.

COPYRIGHT
Copyright © 2003 Sandia Corporation
Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive license for use of this work by or on behalf of the U.S. Government. Redistribution and use in source and binary forms, with or without modification, are permitted provided that this Notice and any statement of authorship are reproduced on all copies.

SEE ALSO
icetDestroyContext, icetGetContext, icetSetContext, icetCopyState, icetGet