Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Threads or no threads?

Name: Anonymous 2007-12-15 17:53

OK so i have this program that dyanamically loads shared objects, it's modules that contain most of the programs functionality.

Now most of the modules i've written so far are very simple, 50 lines or less, just do something simple and return.

Only one module so far absolutely requires a seperate process or thread.

Since anonymous users will be interacting with this program i'm contemplating if i should make it create a new thread for every module it executes or make each module handle that if required.

Basically the main question here is, how safe it is to let any random loser execute commands that has my program create a new thread each time for very simple tasks? Weighed against having all future modules threaded by default.

I'm leaning towards letting each module handle that as it feels fit, because people might have to start writing their own modules for this program in the future and perhaps it's best to let them decide if they want the module to run in a thread or not.

Actually, writing this post has helped me decide on what to do but i'll post it anyways. The program is an irc bot in ansi c, i should have mentioned that.

Name: Anonymous 2007-12-15 18:17

I've personally used per-command threads and a queue per command for IRC bots, but they weren't in a `potentially harmful' environment so to speak.

I don't think it matters much what you use, as long as you don't let users consume too many resources (think of e.g. botnet floods) - but rate limiting/queuing isn't that hard to implement.

Name: Anonymous 2007-12-15 19:35

Yeah i figured a simple counter to keep track of how many threads have been started was even more cumbersome than just creating some sort of queue system right off the bat.

But for now i actually went with regular fork, and module independent. I know, it can be hella exploited, but this is just a project i do for fun and i'll evolve it later when i have time.

Thanks for your info.

Name: Anonymous 2007-12-15 21:43

lrn2erlang

Name: Anonymous 2007-12-15 22:27

>>4
Use a language that has great support for threading but can't do much else unless used in a special environment where somebody has already written all the lower level libraries, like with Ericsson telephony equipment.
fix'd

now get lost

Name: Anonymous 2007-12-16 1:28

lrn2lisp

Name: Anonymous 2007-12-16 10:10

Don't write a fucking IRC bot, there's too many of those already. Write something new and innovative! STOP WASTING KEYSTROKES ON REINVENTING WHEELS THAT HAVE BEEN REINVENTED A MILLION TIMES! IMAGINE THE AMOUNT OF FUCKING GREAT SOFTWARE YOU COULD WRITE IF YOU ONLY WEREN'T TOO STUPID TO DO SOMETHING ORIGINAL! ALSO, WHY THE FUCKING HELL ARE YOU USING AN ARCHAIC AND UGLY LANGUAGE LIKE C? STOP BEING A GODDAMN STAGNANT RETARD AND LEARN A REAL PROGRAMMING LANGUAGE THAT WILL MAKE YOU THINK IN COMPLETELY NEW WAYS! LEARN LISP, SCHEME, HASKELL OR SOMETHING SIMILAR!

Name: Anonymous 2007-12-16 12:39

>>7
LISP, SCHEME, HASKELL
Gentlemen, I present you three of the worst toy languages ever that nobody uses after he's left university.

Name: Anonymous 2007-12-16 13:25

>>8
mother-FUCK-IHAVENTEVENGONETOUNIVERSITY!!!

Name: Anonymous 2007-12-16 14:14

>>9
underageb&

Name: Anonymous 2007-12-17 1:39

Name: Anonymous 2007-12-17 4:10

>>8
Naughty Dog's GOAL.

Name: Anonymous 2007-12-17 5:09

Name: Anonymous 2007-12-17 6:32

>>13
((I love this meme))

Name: Anonymous 2007-12-17 7:47

>>12
DONT HELP HIM!!!

Name: Anonymous 2007-12-19 1:27

>>5
What lower level libraries?  You get everything from socket/file IO up to OpenGL, SDL, and wxWidgets bindings.  What the fuck more do you want for "lower level libraries"?

Name: Anonymous 2007-12-19 8:16

>>16
DirectX COM objects

Name: Anonymous 2007-12-19 20:33

>>5

you are a gigantic faggot

Name: Anonymous 2007-12-19 23:24

If you need threads, use them. If not, don't. Simple as that.

Name: Anonymous 2009-02-25 7:12


From In fact I   actually make MONEY   teaching white folks   how to use   it And for   some reasons why   these Learn X   in Y days   of the Lambda   Republic of Schemeworld?

Name: Anonymous 2011-02-04 15:34

Name: Anonymous 2011-02-17 19:24

check 'em

Don't change these.
Name: Email:
Entire Thread Thread List