@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9



Comments:

<0> then i'd say get it to work first, then try improving it
<1> i have a getthreadid function
<2> can a thread exit legally while "owning" a read or write
<0> oh, that throws a wrench in :/
<1> that's not a problem
<0> it's not?
<1> thread is supposed to use the auto_ thing
<1> if he doesn't **** himself :)
<0> what's "the auto_ thing" ?
<1> like auto_ptr but for locks
<1> it release the lock when goes out of scope
<1> if you don't use them your own problem :)
<1> i care if you do thing properly
<0> that's not the question
<1> if you start messing things up...
<2> we understand



<0> what if the thread simply dies?
<1> it won't
<2> the question was: Is it LEGAL to do so
<1> it's ilegal
<2> k
<0> you don't think you can kill a thread without having it exit gracefully?
<2> we used to write systems where a message would be sent and the thread would quit
<1> i know you can
<1> but you shouldnt :)
<2> reception of a response would start a new thread
<2> and a semaphore/whatever would be "owned" across the pair
<1> i don't get what you are saying vawjr
<2> well, I've ***ured by everyone in boost who worked on threads that "nobody does that" (except all the other embedded guys who were arguing my side)
<1> nobody does that what thing?
<2> the thing you don't understan
<1> someone killing a thread?
<2> acquire a resource, send a message, exit
<1> well
<1> may be that happens
<1> but i think it's much more complex than the thing i actually wany
<1> want
<2> the system starts a new thread when a reply comes.... process message, release resource
<1> so for the time being, it won't support that
<1> in the future may be :)
<2> I wasn't suggesting killing a thread
<1> what are you suggestiong so?
<2> I'm NOT going to type it again
<2> you said you're not going to allow it
<1> yes
<2> where are you going to park the people waitig for your mutex without a container
<1> an event? :) or a semaphore? or anything like that?
<2> what behavor do you want if a current reader wants to write, but there are other readers currently?
<1> is there any option adittional to blocking?
<0> sure, if you create them
<1> (i mean there is also a Try function)
<2> depends on the OS
<1> but if it doesn't "try" you can't let him write it
<1> Windows
<1> :)
<1> what could you do in other os? (just curiosity?)
<0> maybe you should learn how this stuff works before writing it?
<1> :) may be!
<2> I used to write OSs, (well the kernel) they always did what I needed, lol
<1> you can stop all the other threads, but i think that's too agresive!
<1> i want something simple :)
<2> it's a non-trivial problem... I think I said that before
<1> :)
<2> you have to decide what ratio of waiting writers to readers you will allow
<2> or how you want to schedule all of them
<0> why are you trying to create this anyway, Pegazus ?
<1> rdragon: you don't want to know :)
<0> i guess it's not a good reason then
<1> what do you mean by ratio? max number of simultane readers?
<1> what's your point vawjr? :)
<3> 1+1 = 2
<2> it's conceivable that you will have enough things reading that there will always be a couple who can get access to the read portion and then no writers would get through
<1> you mean thread starvation?
<2> or do you plan on suspending someone asking for read access (there already are some readers) if there is a writer waiting?
<1> (i plan to give priority to writers if that what you mean)
<1> or do you plan on suspending someone asking for read access (there already are some readers) if there is a writer waiting? ---> as far as i've read this is the best option, isn't it? :)



<0> what are you controlling access to, anyway?
<1> it's a general thing
<4> has anyone here used visaul studio 2003 and 2005 for c++?
<4> both?
<0> yes, Zelotes
<4> is there a huge difference between the two?
<2> ok, btw, you will then have to make it illegal to ask for write access if you have read access
<4> i have prof 2005 for leanring c++ but i havea book for 2003
<0> i think there is a healthy difference
<4> will a 2003 book be any good for 2005 or what
<1> O_o
<0> well...
<1> i think there is a solution that allows that
<2> the C++ part not a lot ... 2005 is more conformant
<0> C++ is C++
<1> using a linked list on the stack
<0> you should probably be learning C++, not against any specific compiler
<2> a book on the IDE itself? dunno
<4> ya
<4> well just so i know where everythin gis
<0> Zelotes is it a book about C++, or the IDE ?
<2> I recommend _against_ books with any of the following in the title: idiots, dummies, teach, beginning, yourself, learn, seconds, minutes, hours, days, weeks, weekend, tricks, master, guru, visually, super, bible; or that mention a specific product or compiler.
<0> if you want to learn C++: http://www.rudbek.com/books.html
<4> visual c++ step by step 2003
<0> meh
<2> throw it away
<1> how fast is to trigger a windows event? do you know vajwr?
<2> I don't
<2> and it's never been real clear to me what the words mean any longer
<4> acccerlated c++?
<1> what do you think it's faster, trigerr a window event so N threads unlock and check for a condition
<2> they keep changing
<1> or check the condition on a singled linked list of length n
<1> mmm i suppose the ilst
<1> mmmmm
<4> so i buy all those books huh
<1> there is a variant
<1> mm
<2> Zelotes all at once would be overkill
<4> ah
<2> I believe I said at the top read these mostly in the order listed
<4> k
<1> mm
<1> how would you implement a general use read write mutex vawjr?
<0> sounds like an incredibly broad question
<1> :)
<0> why don't you start trying, and then ask questions about problems?
<0> or start reading about other implementations
<1> because i want to make a good design =P
<2> as I said earlier, I always had access to the os kernel before...so we put it where it belongs (in the kernel0
<2> http://www.codeguru.com/cpp/w-p/system/misc/article.php/c5679__1
<1> and i've read about other implementations
<1> i've already read that article
<1> and it uses a map
<0> so?
<1> and i don't think that's nice :$
<0> 'nice' ?
<1> what's the performance of that one?
<2> oh christ
<2> here you go again
<1> :)
<1> why?
<0> the performance is 2.85
<1> heap allocation is slow
<1> as far as i know
<1> that's why i don't like the map thing
<1> :)
<0> you don't even know
<2> about as far as we can throw you
<1> what?
<0> you're worrying about all the wrong things
<2> "make it right, THEN make it fast (if necessary)"
<1> :)
<1> well


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c++
or
Go to some related logs:

speedyghost
#php
you got suwed
webebe
+ scousers + harry enfield + now then
#AllNiteCafe
#MissKitten
#c++
longbow 2 ubuntu
nicknameuri



Home  |  disclaimer  |  contact  |  submit quotes