SST/macro
threading_pth.h
Go to the documentation of this file.
1 /*
2  * This file is part of SST/macroscale:
3  * The macroscale architecture simulator from the SST suite.
4  * Copyright (c) 2009 Sandia Corporation.
5  * This software is distributed under the BSD License.
6  * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7  * the U.S. Government retains certain rights in this software.
8  * For more information, see the LICENSE file in the top
9  * SST/macroscale directory.
10  */
11 
12 #ifndef SSTMAC_SOFTWARE_THREADING_THREADING_PTH_H_INCLUDED
13 #define SSTMAC_SOFTWARE_THREADING_THREADING_PTH_H_INCLUDED
14 
16 #include <pth.h>
17 
18 namespace sstmac {
19 namespace sw {
20 
22 {
23  typedef pth_uctx_t threadcontext_t;
24 
25  private:
26  threadcontext_t context_;
27 
28  public:
29  virtual ~threading_pth() {}
30 
31  virtual
33  return new threading_pth();
34  }
35 
36  // Initializing a context.
37  virtual void
38  init_context();
39 
40  virtual void
42 
43  /// Start a new context.
44  virtual void
45  start_context(int physical_thread_id, void *stack, size_t stacksize, void
46  (*func)(void*), void *args, threading_interface *yield_to);
47 
48  /// Swap context.
49  virtual void
51 
52  /// This is called when we have completed running the thread. It is
53  /// called in the from context.
54  virtual void
56  swap_context(to);
57  }
58 
59 };
60 
61 }
62 } // end of namespace sstmac
63 #endif
64 
threadcontext_t context_
Definition: threading_pth.h:26
virtual void init_context()
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
virtual void destroy_context()
virtual void swap_context(threading_interface *to)
Swap context.
virtual void complete_context(threading_interface *to)
This is called when we have completed running the thread.
Definition: threading_pth.h:55
virtual threading_interface * copy()
Definition: threading_pth.h:32
virtual void start_context(int physical_thread_id, void *stack, size_t stacksize, void(*func)(void *), void *args, threading_interface *yield_to)
Start a new context.