IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1822.40 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-08-10
[17:42]<azyfm>if you do that for accessing all methods and properties, the point of having multiple threads in the first place is pretty much gone
[17:42]<gjrvcxnne>I don't see how
[17:42]<zrrry>it's all about flattening most operations to atomic transactions IMO
[17:43]<ugmnscvjl>hi... how good is the reflection API? can I load assemblies without "binding" them? is there any information loss when using the reflection API instead of parsing metadata manually?
[17:43]<gjrvcxnne>say you spawn the object on a different thread, but have a reference to it on your "main" thread... you can access the cross-thread object without having to worry about invokerequired and such
[17:43]<azyfm>what do you mean "binding them"?
[17:44]<azyfm>objects don't really "belong" to a thread, so it makes little sense to talk of a cross-thread object
[17:44]<zrrry>loading assemblies has nothign to do with binding really
[17:44]<zrrry>when you load the assembly, it gets bound
[17:44]<azyfm>*code* runs on a thread, objects don't
[17:44]<gjrvcxnne>well, objects can have code... which is what i was talking about
[17:44]<gjrvcxnne>(not structs)
[17:44]<ugmnscvjl>Arild: resolving dependancies etc.
[17:45]<azyfm>Yeah, but you can have 100 threads running in the code for one object
[17:45]<gjrvcxnne>i don't get what that means...
[17:45]<zrrry>lol
[17:45]<azyfm>for(int i = 0; i < 100; i++){ Thread t = new Thread(this.ThreadProc); t.Start(); }
[17:45]<azyfm>now you have 100 threads running in the 'this' object
[17:45]<zrrry>undesktop: do you mean you're having trouble using Reflection for loading assemblies dynamically?
[17:46]<azyfm>undesktop: There's a method called .ReflectionOnlyLoad, maybe that's what you want?
[17:46]<gjrvcxnne>i don't know if you understand what i was saying
[17:46]<ugmnscvjl>Arild: I'll try that
[17:47]<zrrry>instance = (MyInterface)ResourceManager.GetModuleByInterfaceName(typeof(MyInterface), myargs); <3
[17:47]<gjrvcxnne>lets say you create an object on your main form, then create 100 threads and pass that object to the constructor of each thread.... if you designed that object the second way from my thread question, then those threads don't call InvokeRequired, nor does the main thread.... the object is "threadsafe"
[17:47]<gjrvcxnne>(even without the calls)
[17:47]<gjrvcxnne>(because the object makes the calls and does the cross thread checking)
[17:48]<gjrvcxnne>all threads can access members of that object without having to worry about threading issues... it's "transparent" to them
[17:48]<azyfm>eh?
[17:49]<azyfm>not following at all
[17:49]<gjrvcxnne>all threads can go theObject.DoSomeShit() or myResults = theObject.GetData()
[17:49]<azyfm>because?
[17:49]<gjrvcxnne>because those methods in theObject check for the cross threading
[17:49]<zrrry>he's using some kind of mehtod-symbol mutex lock
[17:49]<gjrvcxnne>and invoke if needed
[17:50]<azyfm>but then you're basically back to doing everything on one thread
[17:50]<gjrvcxnne>instead of your thread checking if it needs the incoke
[17:50]<gjrvcxnne>very true....
[17:50]<zrrry>that's probably not a fast way to do these things
[17:50]<gjrvcxnne>just saying that it is kinda nifty that you CAN do that lol
[17:50]<gjrvcxnne>and technically, the object is threadsafe
[17:50]<azyfm>.Invoke is slow, by the way
[17:50]<zrrry>isn't there a locking mechanism in the language though?
[17:51]<gjrvcxnne>yeah
[17:51]<azyfm>lock(someObject){ ...protected code... }
[17:51]<zrrry>heh
[17:51]<zrrry>lock (delegate){blah blah}
[17:51]<zrrry>that's prolly what your after then
[17:52]<azyfm>it's basically equivalent to Monitor.Enter(someObject)try{ ... protected code ... } finally{ Monitor.Leave(someObject); }
[17:52]<azyfm>no, no delegates
[17:53]<zrrry>what's teh difference between teh validating and validated events?
[17:53]<zrrry>(i'm just doing a simple login form, first ever form in c# heh)
[17:53]<azyfm>validated happens *after* the control has been validated
[17:53]<azyfm>validating happens during, lets you actually control whether the control is valid
[17:54]<zrrry>ok, so does validating require to return a bool?
[17:54]<azyfm>no, there's a property on the *EventArgs object
[17:54]<zrrry>heh, so it then looks inside to see if it passed? lol, i see
[17:54]<azyfm>no event handler delegates in the fx have a return value
[17:55]<zrrry>meh, fuck efficiency, i'll do it the .net way :)
[17:55]<azyfm>doesn't really make sense to have return values for events, since they may be multicast
[17:55]<zrrry>Arild: aye
[17:56]<zrrry>although component interfaces could specify event subclasses
[17:56]<azyfm>they do - you have a bunch of classes deriving from EventArgs
[17:57]<azyfm>raggi: You should really read Framework Design Guidelines, where they describe the common patterns in the fx and give reasons for why they did it that way
[17:57]<zrrry>Arild: i will do that when i get a chance to come back and refactor this implementation
[17:57]<dbq>can i make a parameter which only a given other object type can change ?
[17:57]<zrrry>for now i just need ot make sure it's not totally crack inspired
[17:58]<zrrry>Arild: thx for the ptr though
[17:58]<azyfm>it's a great book
[18:00]<dbq>or is there a friend like in c++ ?
[18:00]<zrrry>hopefully i won't be doing much gui work (although it is disgustingly easy in here!) as i've got hardcore 2d renderer modules and framework infrastructure to build
[18:00]<zrrry>at the moment i'm in dire need of this login box though, so i'm building this part.
[18:02]<azyfm>raggi: the book isn't limited to just the GUI parts of the framework
[18:02]<zrrry>Arild: understood :)
[18:03]<zrrry>where's the c# regex lib in the .net api?
[18:03]<azyfm>System.Text.RegularExpressions
[18:03]<zrrry>ta
[18:05]<dbq>anybody got any idea on what i asked ?
[18:06]<azyfm>no such thing, DB2
[18:06]<dbq>i see
[18:06]<gjrvcxnne>what was the question?
[18:06]<dbq>in get / set methods i can't check the type of the object who called them maybe ?
[18:07]<gjrvcxnne>no
[18:07]<dbq>i asked <DB2> can i make a parameter which only a given other object type can change ? or <DB2> or is there a friend like in c++ ?
[18:07]<zrrry>use a get(){Assembly.CallerType() == ...)
[18:07]<azyfm>DB2: You might want to look into Code Access Security, though
[18:07]<sjlrac>is there code samples for ADO.NET for something like ebay clothing site available?
[18:07]<azyfm>you can verify that the calling code has a certain permission
[18:08]<ugmnscvjl>Arild: but that's overkill I guess
[18:08]<sjlrac>meaning, filtering with size and brand to filter the query list
[18:08]<zrrry>i love the way i keep providing own implementation hacks then Arild comes back with a standard named api for doing it. :)
[18:08]<azyfm>:-)
[18:09]<zrrry>cause it basically means, my code is going to get shorter and sweeter with every refactor
[18:09]<azyfm>It's not done until there's no more you can remove ;-)
[18:09]<zrrry>although we'll never be using OneClick or the GAC
[18:10]<zrrry>so my code will always be doing that stuff.
[18:14]<dbq>hmm... i'm doing GetMembers() on an base object from within a method, and i dont see the members of the derived objects
[18:15]<zrrry>by derived i presume you mean instance?
[18:16]<dbq>no, i mean there is a base class and dervied class
[18:16]<dbq>the method accepts base class







