Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Threads!

 
Post new topic   Reply to topic Printable version
 View previous topic  Ekted, how about this dope? Post :: Post another alg2 question  View next topic  
Author Message
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sat Sep 03, 2005 4:07 pm   Post maybe stupid    Post subject: Threads! Reply to topic Reply with quote

OK, way back when I was first experimenting with the idea of putting the recv() calls of MERVBot in separate threads, catid said I would have to make a mutex for each plugin. I'm not sure if this is the case.

Here's my basic layout: Class Host "owns" all the loaded plugins. Code in Host, and therefore code in each plugin, is entered in four possible ways: either by the periodic doEvents() function call, the disconnect() function call, the destructor at the end of main(), or by the callback from the receiver loop. doEvents(), disconnect(), and the callback use a mutex. By time the destructor is called, the receiver thread has died.

Does anybody see any possibility for an instance of the plugin to be entered by two threads at once?
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sat Sep 03, 2005 4:49 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Why even bother with this crap? Just make the socket non-blocking and do it synchronously.
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Sep 04, 2005 11:54 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Because WSAWaitForMultipleEvents() was using more time (with a 0ms delay) than any function other than main.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sun Sep 04, 2005 3:37 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

I've never used that function before. I just do:

socket()
connect()
ioctlsocket()
send()
recv()
closesocket()
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Sep 04, 2005 4:20 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Yeah, I don't use it either (I try to stay away from MS extensions...) but catid was. I'm assuming you would just call recv() and then check for WSAEWOULDBLOCK?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Gravitron
VIE Vet


Age:43
Gender:Gender:Male
Joined: Aug 02 2002
Posts: 993
Location: Israel
Offline

PostPosted: Sun Sep 04, 2005 4:30 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Cyan, just accept the fact that you're a moron and this is over your head and stop bothering people with your problems.
Actually, go learn java and form the dorkclub with cerium.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address Yahoo Messenger MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Sep 04, 2005 8:36 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Thanks for gracing my thread with your presence.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 99 page(s) served in previous 5 minutes.

phpBB Created this page in 0.585722 seconds : 32 queries executed (91.5%): GZIP compression disabled