Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
does it exist? I mean, if two threads try to acces at the same variable, what happens? I mean.. you have a lot of threads in a game.. a silent colission in the background, that can happen if various threads use the same var.. so .. do you have to built your own monitors? Lock them up? Would something like this
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
will check all the whiles for missing Sleep(S)
still this is .. strange, so even when there is the feared "harddrive-wait for instructions after cache and memory-miss" it will not pause the thread and idle until the data arrives to make it to the next sleep? Sounds inefficient.. but well, im not an expert.
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
while(weareatit) do Spring.Echo("Wasntit") end
All the whiles get there rest..
Could a Signal fired off end a thread that doesent have a SetSignalMask? I mean, what happens if i Signal(256) and there is no corresponding signal Mask?
Joined: 01 Jun 2005, 10:36 Location: The Netherlands
Yes.
SetSignalMask(name) = give the current thread a name Signal(name) = kill all threads with the given name
So when you call SetSignalMask with a different name than the name inherited from the "parent" thread, the heritage is broken.
If name is a number there is a special case that all threads with a name for which the bitwise-and with the signal is non-zero are killed. So after SetSignalMask(3), both Signal(1) and Signal(2) will kill this thread. Similarly, Signal(3) will kill all threads with a numeric signal mask with either one or both of the least significant bits set.
You can exploit the fact that every new empty table is a unique object to create unique symbolic thread names:
Code:
local MY_UNIQUE_NAME = {} ... Signal(MY_UNIQUE_NAME) SetSignalMask(MY_UNIQUE_NAME)
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum