You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to figure out the proper way to update a shared tds.hash by multiple threads concurrently. The following code inspired after test-threads-shared.lua gives 'Segmentation fault (double free or corruption)' every time I run it:
function f()
local threads = require 'threads'
threads.Threads.serialization('threads.sharedserialize')
local njob = 10
local tds = require 'tds'
local dict = tds.Hash()
collectgarbage()
collectgarbage()
local pool = threads.Threads(
10,
function(threadIdx)
end
)
for k=1,njob do
pool:addjob(
function()
for i = 1,100000 do
dict[i * 11 + k] = math.random()
end
collectgarbage()
collectgarbage()
return __threadid
end,
function(id)
end
)
end
for k=1,njob do
pool:addjob(
function()
collectgarbage()
collectgarbage()
end
)
end
pool:synchronize()
pool:terminate()
return dict
end
a = f()
print(a[1])
Any ideas if the problem is on my side ? Thanks.
The text was updated successfully, but these errors were encountered:
I am trying to figure out the proper way to update a shared tds.hash by multiple threads concurrently. The following code inspired after test-threads-shared.lua gives 'Segmentation fault (double free or corruption)' every time I run it:
Any ideas if the problem is on my side ? Thanks.
The text was updated successfully, but these errors were encountered: