Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "Headers/EngineTaskPool.h"
#include "Headers/Kernel.h"

namespace Divide {

TaskHandle GetTaskHandle(I64 taskGUID) {
    return GetTaskHandle(Application::instance().kernel().taskPool(), taskGUID);
}

TaskHandle CreateTask(const DELEGATE_CBK<void, const Task&>& threadedFunction,
    const DELEGATE_CBK<void>& onCompletionFunction)
{
    return CreateTask(-1, threadedFunction, onCompletionFunction);
}

/**
* @brief Creates a new Task that runs in a separate thread
* @param jobIdentifier A unique identifier that gets reset when the job finishes.
*                      Used to check if the local task handle is still valid
* @param threadedFunction The callback function to call in a separate thread = the job to execute
* @param onCompletionFunction The callback function to call when the thread finishes
*/
TaskHandle CreateTask(I64 jobIdentifier,
    const DELEGATE_CBK<void, const Task&>& threadedFunction,
    const DELEGATE_CBK<void>& onCompletionFunction)
{
    TaskPool& pool = Application::instance().kernel().taskPool();
    return CreateTask(pool, jobIdentifier, threadedFunction, onCompletionFunction);
}

void WaitForAllTasks(bool yeld, bool flushCallbacks, bool foceClear) {
    TaskPool& pool = Application::instance().kernel().taskPool();
    WaitForAllTasks(pool, yeld, flushCallbacks, foceClear);
}

TaskHandle parallel_for(const DELEGATE_CBK<void, const Task&, U32, U32>& cbk,
                        U32 count,
                        U32 partitionSize,
                        Task::TaskPriority priority,
                        U32 taskFlags,
                        bool waitForResult)
{
    TaskPool& pool = Application::instance().kernel().taskPool();
    return parallel_for(pool, cbk, count, partitionSize, priority, taskFlags, waitForResult);
}

}; //namespace Divide

Commits for Divide-Framework/trunk/Source Code/Core/EngineTaskPool.cpp

Diff revisions: vs.
Revision Author Commited Message
842 Diff Diff IonutCava picture IonutCava Wed 01 Feb, 2017 17:25:15 +0000

[IonutCava]
- Start to implement scripting support via ChaiScript: http://chaiscript.com/
- Cleanup DELEGATE_CBK alias

835 IonutCava picture IonutCava Fri 27 Jan, 2017 14:58:07 +0000

[IonutCava]
- Split Engine lib into Core and Engine lib.
- Fix Server build issues