PtokaX forum

Development Section => Your Developing Problems => Topic started by: zero-cool on 30 July, 2007, 23:52:32

Title: Multiple thread and table index
Post by: zero-cool on 30 July, 2007, 23:52:32
Hi,

I've two threads, one updating a table, and other inserting items in it.
However, sometimes it gives me this error:
invalid key to 'next'

Is there any way to avoid this? I think it's related to the fact that table's index are moved at the same time by the two threads.


Best regards,
Title: Re: Multiple thread and table index
Post by: bastya_elvtars on 30 July, 2007, 23:57:16
I think two threads should not be accessing the table the same time. Set a metatable that instructs the later thread to retry later.