source: subversion/applications/utils/mod_tile/gen_tile.h @ 17338

Last change on this file since 17338 was 17338, checked in by apmon, 10 years ago

[renderd] Use a hashtable index to determine pending rendering requests

By eliminating the linear look up of the dirtyQueue for every newly added rendering request, it should be possible
to significantly increase the length of the dirty rendering queue. At the moment the queue length is set to 1000 metatiles,
which at a typical rate of 2 - 3 metatiles a seconds is a buffer of only 5 - 10 minutes. With a much longer
queue, the excess daytime requests can be moved into the quieter night time hours, which could improve the overall long-term
throughput if the server is at its limit of what it can handle.

All operations on the dirty queue should now be O(1).

File size: 830 bytes
Line 
1#ifndef GEN_TILE_H
2#define GEN_TILE_H
3
4#include "protocol.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10#define HTCP_EXPIRE_CACHE 1
11#define HTCP_EXPIRE_CACHE_PORT "4827"
12
13enum queueEnum {queueRequest, queueDirty, queueRender, queueDuplicate};
14
15struct item {
16    struct item *next;
17    struct item *prev;
18    struct protocol req;
19    int mx, my;
20    int fd;
21    struct item *duplicates;
22    enum queueEnum inQueue;
23};
24
25struct item_idx {
26    struct item_idx *next;
27    struct item *item;
28};
29
30//int render(Map &m, int x, int y, int z, const char *filename);
31void *render_thread(void *);
32struct item *fetch_request(void);
33void delete_request(struct item *item);
34void send_response(struct item *item, enum protoCmd);
35void render_init(const char *plugins_dir, const char* font_dir, int font_recurse);
36
37#ifdef __cplusplus
38}
39#endif
40
41#endif
Note: See TracBrowser for help on using the repository browser.