M
Manuel
I've playing around with multi-threading applications lately. The main
problem I have is that when I create a file/table/whatever I need a
unique name. The only way I could come up with, is asking for a
temporary file (System.IO.Path.GetTempFileName) and that file name would
be the unique character string I was looking for.
The same goes for the log report files. I have to use the temp file name
as seed for the random, wait that amount of secs and then write to the
file. It has been the only way I could find for the threads not
colliding with one another.
The random function alone doesn't work simply because it uses the system
clock as seed and if 2 threads happen at the same time, the random
numbers will come up the same.
Is there another way of retrieving a unique character string or number
that the threads can use?
.................................................................
Posted via TITANnews - Uncensored Newsgroups Access-=Every Newsgroup - Anonymous, UNCENSORED, BROADBAND Downloads=-
problem I have is that when I create a file/table/whatever I need a
unique name. The only way I could come up with, is asking for a
temporary file (System.IO.Path.GetTempFileName) and that file name would
be the unique character string I was looking for.
The same goes for the log report files. I have to use the temp file name
as seed for the random, wait that amount of secs and then write to the
file. It has been the only way I could find for the threads not
colliding with one another.
The random function alone doesn't work simply because it uses the system
clock as seed and if 2 threads happen at the same time, the random
numbers will come up the same.
Is there another way of retrieving a unique character string or number
that the threads can use?
.................................................................
Posted via TITANnews - Uncensored Newsgroups Access-=Every Newsgroup - Anonymous, UNCENSORED, BROADBAND Downloads=-