Click here to Skip to main content
16,017,986 members
Home / Discussions / C#
   

C#

 
GeneralRe: Generating Unique Numbers Pin
Dan Neely25-Jul-07 4:43
Dan Neely25-Jul-07 4:43 
AnswerRe: Generating Unique Numbers Pin
Chintan.Desai25-Jul-07 3:07
Chintan.Desai25-Jul-07 3:07 
GeneralRe: Generating Unique Numbers Pin
Jalpesh B. Patel25-Jul-07 4:03
Jalpesh B. Patel25-Jul-07 4:03 
AnswerRe: Generating Unique Numbers Pin
martin_hughes25-Jul-07 3:10
martin_hughes25-Jul-07 3:10 
GeneralRe: Generating Unique Numbers Pin
Jalpesh B. Patel25-Jul-07 3:57
Jalpesh B. Patel25-Jul-07 3:57 
GeneralRe: Generating Unique Numbers Pin
martin_hughes25-Jul-07 4:17
martin_hughes25-Jul-07 4:17 
GeneralRe: Generating Unique Numbers Pin
Jalpesh B. Patel25-Jul-07 4:27
Jalpesh B. Patel25-Jul-07 4:27 
GeneralRe: Generating Unique Numbers Pin
martin_hughes25-Jul-07 5:20
martin_hughes25-Jul-07 5:20 
Ah, I see.

Here's an idea (but I think Luc's is better, now that I've just read it). The major problem you're facing is the IO overhead, and yet you do need some way to prevent duplicates from occuring.

How about booking out blocks of numbers in large chunks (for the sake of argument, say 50,000 at a time), and keeping a file which tells your program the range of the next chunk. That way, if your program crashed it could restart and know what the next chunk of numbers should be, and the number of IO requests would be fewer than with an update after every number issued. Of course, in a situation where your program crashed after only 10 numbers had been issued, you'd have "lost" 49,990 numbers...


"It was the day before today.... I remember it like it was yesterday."

-Moleman


AnswerRe: Generating Unique Numbers Pin
Luc Pattyn25-Jul-07 3:55
sitebuilderLuc Pattyn25-Jul-07 3:55 
GeneralRe: Generating Unique Numbers Pin
CPallini25-Jul-07 4:08
mveCPallini25-Jul-07 4:08 
GeneralRe: Generating Unique Numbers Pin
Luis Alonso Ramos25-Jul-07 7:31
Luis Alonso Ramos25-Jul-07 7:31 
AnswerRe: Generating Unique Numbers Pin
Pete O'Hanlon25-Jul-07 3:55
mvePete O'Hanlon25-Jul-07 3:55 
JokeRe: Generating Unique Numbers Pin
PhilDanger25-Jul-07 4:39
PhilDanger25-Jul-07 4:39 
GeneralRe: Generating Unique Numbers Pin
Jalpesh B. Patel25-Jul-07 4:00
Jalpesh B. Patel25-Jul-07 4:00 
GeneralRe: Generating Unique Numbers Pin
Pete O'Hanlon25-Jul-07 4:07
mvePete O'Hanlon25-Jul-07 4:07 
JokeRe: Generating Unique Numbers Pin
Luc Pattyn25-Jul-07 4:25
sitebuilderLuc Pattyn25-Jul-07 4:25 
JokeRe: Generating Unique Numbers Pin
Pete O'Hanlon25-Jul-07 4:28
mvePete O'Hanlon25-Jul-07 4:28 
GeneralRe: Generating Unique Numbers Pin
Jalpesh B. Patel25-Jul-07 4:29
Jalpesh B. Patel25-Jul-07 4:29 
GeneralRe: Generating Unique Numbers Pin
Pete O'Hanlon25-Jul-07 4:42
mvePete O'Hanlon25-Jul-07 4:42 
AnswerRe: Generating Unique Numbers Pin
snorkie25-Jul-07 8:06
professionalsnorkie25-Jul-07 8:06 
QuestionAssociate File Extension Pin
Bone200325-Jul-07 2:54
Bone200325-Jul-07 2:54 
AnswerRe: Associate File Extension Pin
Chintan.Desai25-Jul-07 3:11
Chintan.Desai25-Jul-07 3:11 
GeneralRe: Associate File Extension Pin
Bone200325-Jul-07 3:20
Bone200325-Jul-07 3:20 
AnswerRe: Associate File Extension Pin
PhilDanger25-Jul-07 3:39
PhilDanger25-Jul-07 3:39 
GeneralRe: Associate File Extension Pin
Bone200325-Jul-07 3:49
Bone200325-Jul-07 3:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.