Skip to content

[Draft] asynchronous GTP pipe.#5

Open
CGLemon wants to merge 11 commits intozakki:developfrom
CGLemon:asynchronous-gtp-draft
Open

[Draft] asynchronous GTP pipe.#5
CGLemon wants to merge 11 commits intozakki:developfrom
CGLemon:asynchronous-gtp-draft

Conversation

@CGLemon
Copy link
Contributor

@CGLemon CGLemon commented Jan 4, 2023

Implement the asynchronous ability GTP pipe in this branch. The concept is borrowed from katrain. I show the ideal here

  1. Push the GTP command (in the query) into queryQueue
  2. One thread reads command from queryQueue. Send the command to engine, then push the current query into waitingQueue
  3. One thread reads current query from waitingQueue and receive GTP response from engine. Push the query and response into finishedQueue if response is end.
  4. Get full response from finishedQueue.

Only implement the synchronous function now.

@zakki
Copy link
Owner

zakki commented Jan 7, 2023

Thanks.

What is reason to introduce asynchronous to cgos client?
I think it is harmless to block on gtp or socket connections.

@CGLemon
Copy link
Contributor Author

CGLemon commented Jan 7, 2023

The design is for analysis command. The reader can get analysis string in real time. My simple ideal is that.

  1. Reader thread gets analysis line and push it into queue.
  2. Client get one or multiple lines from queue and send it to server every x seconds.
  3. Server receive lines and save it as SGF.

If you think this feature is not necessary, I will close this branch. Thanks.

@zakki
Copy link
Owner

zakki commented Jan 7, 2023

At first step, I omit the realtime analysis mode. I look it at next step.

@CGLemon
Copy link
Contributor Author

CGLemon commented Jan 11, 2023

The current asynchronous function works now.

@CGLemon CGLemon mentioned this pull request Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants