View topic - Looking to start a C# AI - Approaches?



All times are UTC + 1 hour


Post new topic Reply to topic  [ 44 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: 14 Feb 2012, 16:52 
Moderator

Joined: 05 Aug 2009, 19:42
I didn't quite understand the priority2 idea, but as far as synchronization goes, it should be ok, since thread 1 is blocked when thread 2 is doing stuff.


Top
 Offline Profile  
 
PostPosted: 14 Feb 2012, 17:49 
User avatar

Joined: 27 Jun 2007, 16:05
Location: Moscow, Russia
gajop wrote:
I didn't quite understand the priority2 idea, but as far as synchronization goes, it should be ok, since thread 1 is blocked when thread 2 is doing stuff.


The idea is that Interface can survive AILib throwing errors, disconnecting and reconnecting to Interface multiple times.

When connection is missing (due to AI Lib Exception or just AI Lib being unloaded), each time handleEvent is fired, Interface checks if connections is present, and if it's not, tries to establish a session. This takes time (approximately 2 seconds).

The idea is to offload connection establishment loop to separate thread as when it's separate we don't care about this 2 seconds being lost in the default thread.

Yesterday night I built the prototype which runs three threads, one is default, one for client and one for server. It all works well, however I expect socket implementation is not thread safe as I'm getting errors inside sockets-related code sometimes. The problem could have been solved by mutex lock preceding every call to socket functions, however the server object in Apache Thrift is implemented as monolithic object, so it doesn't expose any event based callbacks or smth. One solution is to rewrite server code a little bit (thanks god it's open source), however I'm looking more into standard solutions. There should be ones available. Still checking options....


Top
 Offline Profile  
 
PostPosted: 14 Feb 2012, 18:13 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
maybe contact the Apache Thrift devs for that matter.


Top
 Offline Profile  
 
PostPosted: 09 Apr 2012, 06:31 

Joined: 09 Oct 2009, 07:08
Glad to see there are others interested in C#

My first language was Java, but I self taught myself C# for work and now I like almost everything about it.

Unfortunately, I'm not familiar with AWK and C++ so I don't think I would be much use in helping write the interface.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 44 posts ]  Go to page Previous  1, 2, 3

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.