engine: look dictionaries up synchronously
The dictionary thread ran in imthread's own proc, so a lookup could only start once the engine blocked, and it was a trie probe anyway; the emoji and Hanja searches already called dictlookup directly. The request/result channels, sequence numbers, staleness checks and the second draw per Japanese key are gone; dictqjp fills the candidates in place. Emit.dict and Lang.dictq only ever triggered lookups for Vietnamese, which has no dictionary. dictlookup(Lang*, key, out, max) returns the count. The Hanja lookup no longer pre-checks for a single syllable; a reading either has an entry or it does not.
This commit is contained in:
5
main.c
5
main.c
@@ -3,8 +3,6 @@
|
||||
|
||||
Channel *drawc;
|
||||
Channel *keyc;
|
||||
Channel *dictreqc;
|
||||
Channel *dictresc;
|
||||
|
||||
void
|
||||
usage(void)
|
||||
@@ -56,8 +54,6 @@ threadmain(int argc, char **argv)
|
||||
|
||||
drawc = chancreate(sizeof(Drawcmd), 4);
|
||||
keyc = chancreate(sizeof(Keyreq), 0);
|
||||
dictreqc = chancreate(sizeof(Dictreq), 4);
|
||||
dictresc = chancreate(sizeof(Dictres), 0);
|
||||
langinit(argv[1]);
|
||||
srvinit();
|
||||
proccreate(drawthread, nil, 16384);
|
||||
@@ -66,6 +62,5 @@ threadmain(int argc, char **argv)
|
||||
display = getenv("DISPLAY");
|
||||
if(display != nil && display[0] != '\0')
|
||||
proccreate(ximthread, nil, 32768);
|
||||
threadcreate(dictthread, nil, 16384);
|
||||
imthread(nil);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user