View Issue Details

IDProjectCategoryView StatusLast Update
0009543New Feature Requests[All Projects] Generalpublic2017-06-18 20:54
ReporterXeniusAssigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status newResolutionopen 
Summary0009543: [Request] Creating logic threads
Description

My server is using only 25-30% cpu, and in mta performance browser cpu usage is 100%.
Please make a function for creating threads, like C# System.Threading

Example:
<meta>
<newthread value="true"/>
</meta>

Or

function heavyFunction()
-- some code
end

addEventHandler("onResourceStart", resourceRoot, function()
local thread = newThread(heavyFunction)
startThread(thread)
end)

addEventHandler("onResourceStop", resourceRoot, function()
if isThreadRunning(thread) then
stopThread(thread)
end
end)

TagsNo tags attached.

Activities

Xenius

2017-01-30 18:57

viewer   ~~0025657

https://github.com/torch/threads

Jusonex

2017-01-30 21:27

administrator   ~~0025658

The problem is we can only add a very limited subset of MTA's function to such logic threads. That means nearly all functions that manipulate GTA wouldn't be available.

Thus, I'm not sure if it's worth adding them as the only use case I could imagine is for complex calculations, but those are better implemented in C++ anyway.

Issue History

Date Modified Username Field Change