| View previous topic :: View next topic |
| Author |
Message |
Kappa007 Voice
Joined: 26 Jul 2005 Posts: 38
|
Posted: Sat Apr 01, 2006 7:08 pm Post subject: |
|
|
Actually that's the purpose i'm using it already for.
Using MySQL++ in a separate thread... |
|
| Back to top |
|
 |
heretic^ Voice
Joined: 23 Mar 2004 Posts: 5
|
Posted: Sun Apr 09, 2006 9:17 pm Post subject: |
|
|
Yes, i've done this before. I made a thread-safe wrapper for eggdrop's i/o functionality, and yes I did have a valid use for threads as well. It all works great. _________________ In the midst of life, we are in death |
|
| Back to top |
|
 |
Kappa007 Voice
Joined: 26 Jul 2005 Posts: 38
|
Posted: Mon Apr 10, 2006 2:54 am Post subject: |
|
|
See, i'm not the only one
Nevertheless, I think I might change to the "use-tcl-sockets-for-IPC" approach De Kus mentioned.
Just "feels" better than polling some queue once a second. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Apr 10, 2006 3:03 am Post subject: |
|
|
so where is your working, fully functional stuff? (addressing both kappa & heretic)
if it's supposed to serve the general public, please provide a download link to it
if it's private, I see no point of discussing it here _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Mon Apr 10, 2006 11:36 am Post subject: |
|
|
| Kappa007 wrote: | I think I might change to the "use-tcl-sockets-for-IPC" approach De Kus mentioned.
Just "feels" better than polling some queue once a second. |
actually its polled about once every half second. when I used fileevent with millisecond timestamps I noticed they are always in 500ms steps. But usually it doesnt matter if your bot response in 100ms or 500ms, since the user on IRC will both see due to server queue usually at the same time.
A valid use of thread safe eggdrop would be, if you cannot fork into a child process for some reason (like sharing larger amount of data for fast acccess in both ways). But for that purpose you could still hack into the eggdrop mainloop to exchange data with the child without touching offer parts of the bot. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
heretic^ Voice
Joined: 23 Mar 2004 Posts: 5
|
Posted: Fri Apr 14, 2006 4:02 pm Post subject: |
|
|
| demond wrote: | so where is your working, fully functional stuff? (addressing both kappa & heretic)
if it's supposed to serve the general public, please provide a download link to it
if it's private, I see no point of discussing it here |
http://www.scorebots.org
I cant really release the source code, but i'm more than willing to supply help to anyone that needs it.
I basically created a cmodule to run multiple "scorebots" per single eggdrop. The reason why I needed to use threads instead of some "polling" system was to create real time output in relation to the "scorebot". Right now I run a free IRC service to the users of the GameSurge network. Currently we are serving over 500 channels. _________________ In the midst of life, we are in death |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Fri Apr 14, 2006 5:17 pm Post subject: |
|
|
so basicly every single scorebot is single threaded again?! Thats no multithreading like demond wanted it to hear . The problems that occur with multithreading is only meaningfull, when there is more than one thread for the same bot/IRC connection. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
heretic^ Voice
Joined: 23 Mar 2004 Posts: 5
|
Posted: Fri Apr 14, 2006 7:31 pm Post subject: |
|
|
yes, multi-threaded in the fact that if channel #a has ScoreBot-01 and channel #b has ScoreBot-01 and they're both running a scorebot at the same time, then there are 2 threads running the scorebot code.
each thread has to allocate at least 1 UDP socket, and sometimes 1 TCP socket to connect to and interact with the desired gameserver, then it parses the gamelogs updates a few player nodes, and outputs through a thread-safe function _________________ In the midst of life, we are in death |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Fri Apr 14, 2006 9:44 pm Post subject: |
|
|
| heretic^ wrote: | | demond wrote: | so where is your working, fully functional stuff? (addressing both kappa & heretic)
if it's supposed to serve the general public, please provide a download link to it
if it's private, I see no point of discussing it here |
http://www.scorebots.org
|
nothing to download there, so it's basically irrelevant to this forum's purpose (at least as I understand it - it's not about MT in general and even not about the programming in general, but about eggdrop and eggdrop modules programming - and eggdrop is open-source) _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
heretic^ Voice
Joined: 23 Mar 2004 Posts: 5
|
Posted: Sat Apr 15, 2006 6:12 am Post subject: |
|
|
| Kappa007 wrote: | | Anyone seen/used any other approach? |
| demond wrote: | | nothing to download there, so it's basically irrelevant to this forum's purpose (at least as I understand it - it's not about MT in general and even not about the programming in general, but about eggdrop and eggdrop modules programming - and eggdrop is open-source) |
I'm sorry if you feel that's irrelevant but I was merely responding to Kappa's post, I apologize if I offended you in the process of contributing to this thread. I'm not trying to start a flamewar here or anything I was just merely responding to the author of this thread. _________________ In the midst of life, we are in death |
|
| Back to top |
|
 |
Kappa007 Voice
Joined: 26 Jul 2005 Posts: 38
|
Posted: Sat Apr 15, 2006 11:41 am Post subject: |
|
|
| No hurry, i'll put my stuff under public domain once i got time to cleanup the code... |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Apr 15, 2006 4:00 pm Post subject: |
|
|
| heretic^ wrote: | | Kappa007 wrote: | | Anyone seen/used any other approach? |
| demond wrote: | | nothing to download there, so it's basically irrelevant to this forum's purpose (at least as I understand it - it's not about MT in general and even not about the programming in general, but about eggdrop and eggdrop modules programming - and eggdrop is open-source) |
I'm sorry if you feel that's irrelevant but I was merely responding to Kappa's post, I apologize if I offended you in the process of contributing to this thread. I'm not trying to start a flamewar here or anything I was just merely responding to the author of this thread. |
no offense taken, you've done a good job; hopefully you'll share it some day with the community _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
|