From 9a95a8ec3099a323b9b8796c0336b0dd7f0f1ef7 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 5 Jul 2012 13:57:57 +0000 Subject: [PATCH] ps3: fix CPU and stack size performance issues on the PS3. --- src/platform/ps3/threadbase.h | 5 ++++- src/ticker.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/platform/ps3/threadbase.h b/src/platform/ps3/threadbase.h index cf8c26be..94f3da76 100644 --- a/src/platform/ps3/threadbase.h +++ b/src/platform/ps3/threadbase.h @@ -126,9 +126,12 @@ class ThreadBase public: ThreadBase(void *(*fn)(void *), void *data) { + size_t stack_size = 128 * 1024; + char const *thread_name = "new thread"; + /* FIXME: choose priority more wisely */ sys_ppu_thread_create(&m_thread, (void (*)(uint64_t))fn, - (uint64_t)data, 1000, 0, 0, "new thread"); + (uint64_t)data, 1000, stack_size, 0, thread_name); } virtual ~ThreadBase() diff --git a/src/ticker.cpp b/src/ticker.cpp index a3c67194..b3c5c387 100644 --- a/src/ticker.cpp +++ b/src/ticker.cpp @@ -314,7 +314,12 @@ void *TickerData::DiskThreadMain(void * /* p */) { #if defined __CELLOS_LV2__ /* FIXME: temporary hack to avoid crashes */ - for (;;); + Timer t; + for (;;) + { + t.Get(); + t.Wait(0.001f); + } #endif return NULL; }