Skip to content

Commit 2f828e2

Browse files
committed
experiment: use burst mode for IO
IO threads DO get called by the main thread, but the main thread ends up doing the IO thread jobs anyway. how about we let the IO threads continue to swarm over the jobs,and then let the main thread pick up after it, doing whatever work it needs to do. a prerequisite to every call is that the queue is processed. so why not process it on the threads?
1 parent 7386d0d commit 2f828e2

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

src/game/shared/querycache.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
// $NoKeywords: $
66
//
77
//=============================================================================//
8-
#if SUPPORT_QUERY_CACHE
8+
99
#include "cbase.h"
1010
#include "querycache.h"
11+
12+
#if SUPPORT_QUERY_CACHE
1113
#include "tier0/vprof.h"
1214
#include "tier1/utlintrusivelist.h"
1315
#include "datacache/imdlcache.h"

src/game/shared/querycache.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
#define SUPPORT_QUERY_CACHE 0
1919
#endif
2020

21-
#if SUPPORT_QUERY_CACHE
22-
23-
#include "mathlib/vector.h"
24-
2521
// this system provides several piece of functionality to ai or other systems which wish to do
2622
// traces and other trace-like queries.
2723

@@ -31,6 +27,16 @@
3127
// b. By updating the cache entries outside of the entity think functions, the update is done in a
3228
// fully multi-threaded fashion
3329

30+
enum EEntityOffsetMode_t
31+
{
32+
EOFFSET_MODE_WORLDSPACE_CENTER,
33+
EOFFSET_MODE_EYEPOSITION,
34+
EOFFSET_MODE_NONE, // nop
35+
};
36+
37+
#if SUPPORT_QUERY_CACHE
38+
39+
#include "mathlib/vector.h"
3440

3541
enum EQueryType_t
3642
{
@@ -40,13 +46,6 @@ enum EQueryType_t
4046

4147
};
4248

43-
enum EEntityOffsetMode_t
44-
{
45-
EOFFSET_MODE_WORLDSPACE_CENTER,
46-
EOFFSET_MODE_EYEPOSITION,
47-
EOFFSET_MODE_NONE, // nop
48-
};
49-
5049

5150
#define QCACHE_MAXPNTS 3 // maximum number of points/entities
5251
// involved in a query

src/vstdlib/jobthread.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,7 @@ bool CThreadPool::Start( const ThreadPoolStartParams_t &startParams, const char
12121212
{
12131213
iLoad = CJobThread::Burst;
12141214
}
1215+
iLoad = CJobThread::Burst;
12151216
m_Threads[iThread] = new CJobThread( this, iThread, false, iLoad );
12161217
m_IdleEvents[iThread] = &m_Threads[iThread]->GetIdleEvent();
12171218
m_Threads[iThread]->SetName( CFmtStr( "%s%d", pszName, iThread ) );

0 commit comments

Comments
 (0)