Bullet Collision Detection & Physics Library
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
PosixThreadSupport Class Reference

#include <PosixThreadSupport.h>

Inheritance diagram for PosixThreadSupport:
Inheritance graph
[legend]
Collaboration diagram for PosixThreadSupport:
Collaboration graph
[legend]

Classes

struct  btSpuStatus
 
struct  ThreadConstructionInfo
 Setup and initialize SPU/CELL/Libspe2. More...
 

Public Types

enum  sStatus {
  STATUS_BUSY,
  STATUS_READY,
  STATUS_FINISHED
}
 
typedef enum
PosixThreadSupport::sStatus 
Status
 

Public Member Functions

 PosixThreadSupport (ThreadConstructionInfo &threadConstructionInfo)
 
virtual ~PosixThreadSupport ()
 cleanup/shutdown Libspe2 More...
 
void startThreads (ThreadConstructionInfo &threadInfo)
 
virtual void sendRequest (uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1)
 send messages to SPUs More...
 
virtual void waitForResponse (unsigned int *puiArgument0, unsigned int *puiArgument1)
 check for messages from SPUs More...
 
virtual void startSPU ()
 start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded) More...
 
virtual void stopSPU ()
 tell the task scheduler we are done with the SPU tasks More...
 
virtual void setNumTasks (int numTasks)
 tell the task scheduler to use no more than numTasks tasks More...
 
virtual int getNumTasks () const
 
virtual btBarriercreateBarrier ()
 
virtual btCriticalSectioncreateCriticalSection ()
 
virtual void deleteBarrier (btBarrier *barrier)
 
virtual void deleteCriticalSection (btCriticalSection *criticalSection)
 
virtual void * getThreadLocalMemory (int taskId)
 
- Public Member Functions inherited from btThreadSupportInterface
virtual ~btThreadSupportInterface ()
 

Private Attributes

btAlignedObjectArray< btSpuStatusm_activeSpuStatus
 

Detailed Description

Definition at line 42 of file PosixThreadSupport.h.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
STATUS_BUSY 
STATUS_READY 
STATUS_FINISHED 

Definition at line 45 of file PosixThreadSupport.h.

Constructor & Destructor Documentation

PosixThreadSupport::PosixThreadSupport ( ThreadConstructionInfo threadConstructionInfo)

Definition at line 35 of file PosixThreadSupport.cpp.

PosixThreadSupport::~PosixThreadSupport ( )
virtual

cleanup/shutdown Libspe2

Definition at line 41 of file PosixThreadSupport.cpp.

Member Function Documentation

btBarrier * PosixThreadSupport::createBarrier ( )
virtual

Implements btThreadSupportInterface.

Definition at line 387 of file PosixThreadSupport.cpp.

btCriticalSection * PosixThreadSupport::createCriticalSection ( )
virtual

Implements btThreadSupportInterface.

Definition at line 394 of file PosixThreadSupport.cpp.

void PosixThreadSupport::deleteBarrier ( btBarrier barrier)
virtual

Implements btThreadSupportInterface.

Definition at line 399 of file PosixThreadSupport.cpp.

void PosixThreadSupport::deleteCriticalSection ( btCriticalSection criticalSection)
virtual

Implements btThreadSupportInterface.

Definition at line 404 of file PosixThreadSupport.cpp.

virtual int PosixThreadSupport::getNumTasks ( ) const
inlinevirtual

Implements btThreadSupportInterface.

Definition at line 122 of file PosixThreadSupport.h.

virtual void* PosixThreadSupport::getThreadLocalMemory ( int  taskId)
inlinevirtual

Reimplemented from btThreadSupportInterface.

Definition at line 136 of file PosixThreadSupport.h.

void PosixThreadSupport::sendRequest ( uint32_t  uiCommand,
ppu_address_t  uiArgument0,
uint32_t  uiArgument1 
)
virtual

send messages to SPUs

gMidphaseSPU.sendRequest(CMD_GATHER_AND_PROCESS_PAIRLIST, (uint32_t) &taskDesc);

we should spawn an SPU task here, and in 'waitForResponse' it should wait for response of the (one of) the first tasks that finished

not implemented

Implements btThreadSupportInterface.

Definition at line 124 of file PosixThreadSupport.cpp.

virtual void PosixThreadSupport::setNumTasks ( int  numTasks)
inlinevirtual

tell the task scheduler to use no more than numTasks tasks

Implements btThreadSupportInterface.

Definition at line 120 of file PosixThreadSupport.h.

void PosixThreadSupport::startSPU ( )
virtual

start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)

Implements btThreadSupportInterface.

Definition at line 230 of file PosixThreadSupport.cpp.

void PosixThreadSupport::startThreads ( ThreadConstructionInfo threadInfo)

Definition at line 197 of file PosixThreadSupport.cpp.

void PosixThreadSupport::stopSPU ( )
virtual

tell the task scheduler we are done with the SPU tasks

Implements btThreadSupportInterface.

Definition at line 236 of file PosixThreadSupport.cpp.

void PosixThreadSupport::waitForResponse ( unsigned int *  puiArgument0,
unsigned int *  puiArgument1 
)
virtual

check for messages from SPUs

We should wait for (one of) the first tasks to finish (or other SPU messages), and report its response

A possible response can be 'yes, SPU handled it', or 'no, please do a PPU fallback'

Implements btThreadSupportInterface.

Definition at line 161 of file PosixThreadSupport.cpp.

Member Data Documentation

btAlignedObjectArray<btSpuStatus> PosixThreadSupport::m_activeSpuStatus
private

Definition at line 69 of file PosixThreadSupport.h.


The documentation for this class was generated from the following files: