SST/macro
threading_interface.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_INTERFACE_H_INCLUDED
13 #define SSTMAC_SOFTWARE_THREADING_THREADING_INTERFACE_H_INCLUDED
14 
16 #include <errno.h>
17 #include <cstring>
18 #include <iostream>
19 
20 namespace sstmac {
21 namespace sw {
22 
23 
25 {
26  public:
27  virtual ~threading_interface() {}
28 
29  virtual threading_interface*
30  copy() = 0;
31 
32  virtual void
33  init_context() = 0;
34 
35  virtual void
36  destroy_context() = 0;
37 
38  /// Start a new context.
39  virtual void
40  start_context(int physical_thread_id,
41  void *stack, size_t stacksize, void
42  (*func)(void*), void *args, threading_interface *yield_to) = 0;
43 
44  /// Swap context.
45  virtual void
47 
48  /// This is called when we have completed running the thread. It is
49  /// called in the from context.
50  virtual void
52 };
53 }
54 } // end of namespace sstmac
55 #endif
56 
virtual threading_interface * copy()=0
virtual void complete_context(threading_interface *to)=0
This is called when we have completed running the thread.
virtual void destroy_context()=0
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
virtual void start_context(int physical_thread_id, void *stack, size_t stacksize, void(*func)(void *), void *args, threading_interface *yield_to)=0
Start a new context.
virtual void swap_context(threading_interface *to)=0
Swap context.