Archived
1
0
Fork 0
Commit graph

8 commits

Author SHA1 Message Date
Henrik Hautakoski
697d512ea6 lockfile: Remove force parameter from hold_lock()
If user wants to 'force' a lock, he/she will have to remove the file
manually. some wierd race conditions may happen if different processes optains the
same lock at any given time (thats why lockfile is implemented in the first place)
So lockfile API should not in any circumstances directly provide a way to force taking a lock.
2013-10-17 15:57:42 +02:00
Henrik Hautakoski
223706d52f hash: Replace struct with a primitive type for hash values.
Remove the struct hash_entry and define a new type for hash values.
Most likely we will only need one member in this struct. and instead
of just using unsinged int. let's name a new type for clarity.
2012-08-22 15:42:20 +02:00
Henrik Hautakoski
b967d1b147 proc-cache.c: free entries in the hash table. 2012-07-18 19:27:17 +02:00
Henrik Hautakoski
ae91737fb1 proc-cache.c: lazy delete
Use lazy delete mechanism to remove the need for linked list delete.
This removes the need for a sentinel node at the beginning.
2012-07-04 12:02:42 +02:00
Henrik Hautakoski
365b657f9f proc-cache.c: use hash-table code from hash.c
Use the refactored code from hash.c also
use chaining as the collision strategy instead of
open-adressing, not only becouse the new hash api makes it hard
to do but it is more space efficient.

Since a collision with open-adressing results in two entries
in the hash table but with chaining, we only have one.
the complexity for search/insert/delete is still O(n) for both techniques.
Chaining is better because items that collide only takes up one slot in the
hash table, considering that the best-case for space overflow is 25%. it
is better to have a small table.
2012-05-22 11:48:28 +02:00
Henrik Hautakoski
e0976e0d23 proc-cache.c: remove proc_cache_flush()
flush() is redundant, it makes more sense to just write the file on close().
There is no reason why you want to commit the current state of the cache to disk
at any other time then when closing the application.
2012-04-17 21:14:49 +02:00
Henrik Hautakoski
4f05a5ae4f proc-cache.c: use hash-table code from hash.c 2012-04-12 07:46:28 +02:00
Henrik Hautakoski
1350330dd2 dlhist: rename to proc-cache.
A new datastructure is about to take dlhist place. dlhist is currently
implemented as a mixture of an "process cache" that should record what
rss items has been processed (that is why the url is used as a unique
identifier), but right now it only stores an url if it has been
downloaded. A new datastructure that should be "download history"
shall be implemented, that will keep track of what title and where
it has been downloaded to. this will make it possible to only
download an rss title to a location once.

Splitting this datastructure into two separated structures is trivial
as a "process cache" will threat URL's as a unique identifier and
a "download history" will threat the title in an rss item as a
unique identifier (and also track it's destinations).

This commit does not change any functionality, I just rename
this to keep the "dlhist" prefix and source files clear for
when implementing the real dlhist.
2011-11-14 16:11:18 +01:00
Renamed from dlhist.c (Browse further)