Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET REPROCESS TO
Message
From
28/12/1998 15:45:31
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
27/12/1998 19:22:26
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00169741
Message ID:
00170923
Views:
37
>Hi Bob,
>That's a fair enough approach, but I'm surpised about bloat from Deleted(). Rethinking this, Dragan's method might be much better than mine in many circumstances because the deleted records can be 'clustered' or clumped together in the data set, in which case taking a random point in the full file, using reccount(), might cause say a 90% hit for example on a particular deleted record. This defeats the purpose. Your scheme might also suffer this.
>
>(Dragan's method took a random point amongst the deleted records only)

Well, I assumed that we have a tag on deleted(), since the deletion mark of the record is important here. In Bob's case, he'd probably have the index on LDeleted. My method could be faster if we had about 10% of deleted records, but in his case his way is probably faster than mine. I'm just amazed at the fact that the record may have been already done by someone else before the RLock() was placed... I mean this:

go 1 + (rand() * lnRecCount) && randomly select a record (for most records,
if ldeleted and rlock() && lDeleted = .t.)
if ldeleted && It didn't changed while we were getting
lnReturnedRecNo = recno() && the lock so we will send back it's
exit && record # for recycling.
else
unlock record recno() && unlock JUST this one (It was lDeleted, but
endif && by the time we got the lock, it wasn't!)
endif

It must really be crowdy at his network if between the first line and the end of the second line someone else may update the record. I'm just wandering what would I do if I had such a situation... I know! I'd search back for this thread :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform