Re: Multitasking and containers




Dmitry A. Kazakov wrote:

Further, even on a single CPU, where protected functions and procedures are
equivalent, the requirement "no task switches while lock held" might be
unacceptable if you hold it for too long.

But this is already a precondition for using a protected object as a
monitor. The RM makes it clear that you shouldn't be doing anything
that takes "too long" inside a protected operation.


Searching a container within a
protected action ... well, one should be a quite strong believer for this.

If this is an associative container then no problem. If this is a
sequence container with many elements, well that's another story.


I wouldn't dismiss it completely, but I definitely don't like it. For
hashes I would at least take one with an external hash function computed
outside the protected action.

The issue with hash tables is not the computation of the hash value,
but rather if the hash function is poor and there are many collisions.
If that's the case then the time to compare the key to items already in
that bucket will be large compared to the cost of computing the hash
value itself.

.



Relevant Pages

  • Re: Suggestions for double-hashing scheme
    ... >> secondary hash function to 1/4 of the table size, ... > Hsieh is considered a laughing stock in many circles, ... Thats more typedefs than in all of bstrlib already. ... (Compare this to Bstrlib, whose influence ...
    (comp.programming)
  • Re: Detecting Brute-Force and Dictionary attacks
    ... usually modern systems doesn't compare the password you ... password attempt with the saved hash of your current password. ... It is my personal opinion that evaluating the passwords so closely, such as mentioned in the previous email to Greg's, would open yourself up to a far more complicated world than you might be thinking. ... In the past, when I've had people attempting to attack my systems, the easiest way to tell is the number of login attempts against the frequency of the attempts. ...
    (Focus-Linux)
  • Re: How good are checksums?
    ... >checksum and compare file lengths. ... >duplicate very low. ... I use a fast Adlerian checksum. ... Your problem is similar to what to do with hash table collisions. ...
    (comp.lang.java.programmer)
  • Re: Byte to byte compare, duplicate file finder/killer
    ... cryptographically strong hash, simply because the CRC ... By using a secure hash instead of CRC, the actual byte-to-byte compare ... checksum (files with identical CRCs or checksums are trivial to ...
    (comp.programming)
  • Compare datasets with hash values or possibly another way?
    ... hash values of the datasets and compare those. ... ' Create a new instance of memory stream ... Dim formatter As New BinaryFormatter ...
    (microsoft.public.vstudio.general)