Page 1 of 1
How to stop monitoring PV's ?
Posted: Thu Sep 05, 2019 10:52 am
by Henk
Client is using a Hub for monitoring pv's generated.
But Hub is unable to store state.
So how can a client stop monitoring.
In the past I used database to store state but is there no better solution. Using a database is ugly.
Hub can access client. Client can access hub. But cancellationToken is local.
Maybe these tasks or threads are globally accesible?
In that case Hub can look up the task and stop it.
Re: How to stop monitoring PV's ?
Posted: Thu Sep 05, 2019 11:39 am
by Henk
Using .net of course.
Maybe taskscheduler? Or Task.(something I don't know yet)
Re: How to stop monitoring PV's ?
Posted: Thu Sep 05, 2019 12:57 pm
by Henk
Maybe Hub has no problems with storing static data. In that case I store these cancelation token (source)s as static data and problem solved.
Although ugly solution as well if it works.
Re: How to stop monitoring PV's ?
Posted: Fri Sep 06, 2019 12:53 am
by Sven
What exactly does "monitoring PVs" mean in your case? If your engine conforms to either of the two protocols CECP (WinBoard) or UCI then it will print lines containing PV information during search, either in the standard (or even extended) WinBoard format or through an appropriate "info" command for UCI. CECP has "post" and "nopost" commands that tell the engine that it should or should not print PV information from now on, and if an engine implements these two commands then that is already the way how it works for WinBoard (if that is what you want to achieve). For UCI I don't know whether there is a standard way to suppress PV output, I don't think there is one, I only know a "de facto standard option" to enable/disable *current variation* output.
Maybe you were even talking about something completely different ... hubs and .NET, not my world ...
Re: How to stop monitoring PV's ?
Posted: Fri Sep 06, 2019 10:26 am
by Henk
Client or clients are browsers. Hub runs on internet information server.
Maybe I better switch to WPF. For only 'stupid' or non-interesting applications run on internet.
How can a server search for best moves for chess positions for many clients simultaneously.
Server is not capable to do that. Or it must be a super computer or many servers
I am not going to let engine run on the client. Will be too slow I guess.
Because interpreters are slow and development is slow for you get more run time errors.
And then I should learn javascript, typescript or perhaps xslt. While I am used to C#.
My chess web application is only local. Inconvenient for you have to start browser plus iis.
I was going to port it to .net core.
But singleR for .net core changed. Also Entity framework changed compared to .net.
Unfortunately I don't know anything about WPF. So it will take time to learn and perhaps to costly.
By the way if I store Cancellor as a static variable in the Hub start/stop analysis worked. But ugly solution.
Console application is already ported to .net core. Was easy if you don't use EF(database).
Re: How to stop monitoring PV's ?
Posted: Fri Sep 06, 2019 11:01 am
by Henk
Maybe I will post a new video on YouTube to show monitoring PV's using signalR on .net core.
Or perhaps post some code. But I hacked it together for I was only interested in 'proof of concept' and it all took too much time.
Even signalR exercise on microsoft website for .net core 2.2 missed an important statement. Took four hours too find out.
[Making me crazy. Also neigbors fighting. So I am not only lunatic here. In Holland there is lack of room. So over aged children living with their parents fighting all day until police arrives. Problem for me is the noise of course. But I should have used earplugs. Although that doesn't work for often they scream for help and police]
Did not try a Chess webAPI instead of ChessHub. Maybe interesting too.
Re: How to stop monitoring PV's ?
Posted: Fri Sep 06, 2019 11:56 am
by Henk
Hi hi hi. Maybe an idea is create a livestream on YouTube titled 'Solving Chess' showing process of finding PV for initial position.
Maybe run livestream every day and see how many viewers you get. Or has this already been done.
Re: How to stop monitoring PV's ?
Posted: Fri Sep 06, 2019 12:14 pm
by Henk
Henk wrote: ↑Fri Sep 06, 2019 11:01 am
Maybe I will post a new video on YouTube to show monitoring PV's using signalR on .net core.
In the meantime: Just using stupid Skipper library producing crap PV's as usual. Even formatting does not work. So have to fix that first.
(Seconds must be centiseconds I guess)
Code: Select all
Depth Value Time(seconds) Nodes
1 45 7 20 d2d4
2 5 9 107 d2d4 d7d5
3 44 12 541 e2e4 e7e5 d2d4
4 1 17 1259 e2e4 e7e5 d1h5 d7d6
5 26 18 1999 e2e4 e7e5 d2d4 e5d4 d1d4
6 6 32 5498 e2e4 e7e5 f1c4 c7c6 d1h5 d8e7
7 43 43 9353 e2e4 e7e5 d2d4 e5d4 d1d4 a7a6 d4d1
8 27 72 19795 e2e4 e7e5 d2d4 e5d4 d1d4 c7c6 c1f4 c6c5
9 31 224 89219 e2e4 e7e5 d2d4 e5d4 d1d4 d8e7 d4a4 e7b4 a4b4
10 14 891 404625 e2e3 e7e5 d2d4 e5e4 c2c4 f8b4 b1d2 d8g5 a2a3 g5a5
11 24 1750 899333 e2e4 e7e5 d2d4 e5d4 d1d4 b8c6 d4d5 d8h4 f1c4 f8b4 b1d2
12 2 4492 1925766 d2d4 d7d5 e2e3 c7c5 d4c5 b8c6 b1c3 e7e6 c3a4 e6e5 f1d3 f8e7
Analysis stopped