|
I mean it looks like you're trying to do a modal dialog in the weirdest way possible. like maybe the compiler is optimizing the loop so it doesn't send the updates to the other "window" until its done processing the loop? idk. weird as gently caress dude. also maybe put ActiveWindow = New GenericWaitWindow in the constructor or something maybe cause that's whats probably null when you're calling that delegate. Like you're running the long running task on the main ui thread and then spawning a second ui thread to display the wait dialog. that's backwards as hell. what you want to do is run the long running task in a background thread and leave the main UI thread working and disable input when the thing kicks off and re-enable it/show results when complete. So when a user clicks a button you disable input and then fire off the long running task in a background thread with a callback that re-enables input and shows results. you can also pass a reference to a progress property to the long running task so it can send updates while it works back to the ui thread.
|
# ? Jul 18, 2014 21:09 |
|
|
# ? May 27, 2024 04:54 |
|
why would you disable the main UI waiting for the long running thread to finish why not just put everything on 1 thread at that point
|
# ? Jul 18, 2014 21:14 |
|
blocking ui thread is a bad thing on any UI framework, that's what triggers the "not responding" status
|
# ? Jul 18, 2014 21:17 |
|
DO NOT BLOCK THE UI THREAD
|
# ? Jul 18, 2014 21:18 |
|
MeruFM posted:why would you disable the main UI waiting for the long running thread to finish I didn't say to disable the main thread I said to disable input on the main thread. the user can still interact and do stuff and maybe go to other parts of the app, they just cant relaunch that specific task (which is the point of the modal dialog)
|
# ? Jul 18, 2014 21:20 |
|
like you could have a cancel button and progress bar in there or whatever as well, but the point is you disable specific input to prevent resubmission of the task. you don't block the main thread and you don't block the main thread and spawn a separate ui thread (what gently caress them is currently doing)
|
# ? Jul 18, 2014 21:21 |
|
ok when i saw disable input, i thought you meant just freeze the main UI
|
# ? Jul 18, 2014 21:23 |
|
oh god how the gently caress do I do multithreading/async is there a book help
|
# ? Jul 18, 2014 21:50 |
|
uncurable mlady posted:oh god how the gently caress do I do multithreading/async yes, it's called the Kama Sutra, because you are getting hosed 6 ways to sunday
|
# ? Jul 18, 2014 21:57 |
|
Parallel.ForEach
|
# ? Jul 18, 2014 22:18 |
|
uncurable mlady posted:oh god how the gently caress do I do multithreading/async this is a pretty decent example: http://msdn.microsoft.com/en-us/library/hh191443.aspx async is not necessarily multithreading, it just lets the compiler know it can continue other work while waiting for the result of the async method to return. it takes a little getting used to but it ends up being way easier to use than threads and just as effective (if not more so because threads are big objects) the Task async pattern is kind of similar to futures in that you fire off an async method that returns SomeType and instead of SomeType you get back a Task<SomeType> you can continue doing parallel work after your call to the async method. then once you've done all your work (or fired off all the async methods you wanted) you can then await the result of the task. Basically, make all your methods async. Then when you are calling your async methods, ask "Do I need this result before the next statement?" if not, collect the Task from the method and continue on. If you do need the result for the next statement, or if you have the Task and you have done other work and now you need the result for the next statement, await the Task's completion. Czech out the example in that msdn doc its turtles all the way down.
|
# ? Jul 18, 2014 22:33 |
|
please read a book
coffeetable fucked around with this message at 22:56 on Jul 18, 2014 |
# ? Jul 18, 2014 22:45 |
|
uncurable mlady posted:oh god how the gently caress do I do multithreading/async and while checking that i got the names right for those, ive just spotted Seven Concurrency Models in Seven Weeks which is deffo going on my reading list
|
# ? Jul 18, 2014 22:56 |
|
coffeetable posted:The Little Book of Semaphores is great for practicing how you reason about concurrent code, but its very "low level" and you'll want a language-specific book as well to introduce you to yr language's constructs. if you're working in java, Java: Concurrency in Practice is v good, even if it's missing the fork/join stuff that turned up in Java 7. thanks, this is useful
|
# ? Jul 18, 2014 22:59 |
|
coffeetable posted:please read a book pls keep your personal vendetta against me in pms and out of the threads thnx
|
# ? Jul 18, 2014 23:30 |
|
coffeetable posted:The Little Book of Semaphores is great for practicing how you reason about concurrent code, but its very "low level" and you'll want a language-specific book as well to introduce you to yr language's constructs. if you're working in java, Java: Concurrency in Practice is v good, even if it's missing the fork/join stuff that turned up in Java 7. Thanks for the useful post
|
# ? Jul 18, 2014 23:30 |
|
gently caress them posted:pls keep your personal vendetta against me in pms and out of the threads thnx Maybe you should try reading a book? lol
|
# ? Jul 18, 2014 23:37 |
|
Bloody posted:Parallel.ForEach
|
# ? Jul 19, 2014 00:34 |
|
use scala
|
# ? Jul 19, 2014 00:35 |
It's good that Mozilla brought Steve Klabnik in full time since he's certainly putting in the work on the Rust docs. I'd like to spend some time with it but it still seems pretty unstable at this point and I have another few hundred pages of Programming in Scala to cover. Mozi posted:use scala I've been feeling pretty apathetic about it (Scala) lately though, which is certainly not good considering it's my current job's primary language. I feel like it's not a great thing when a programming language requires me to have a PhD and/or be completely insane to be able to contribute anything to a majority of libraries being developed.
|
|
# ? Jul 19, 2014 00:40 |
|
uncurable mlady posted:oh god how the gently caress do I do multithreading/async ljw1004 please its like ur batsignal Malcolm XML fucked around with this message at 00:43 on Jul 19, 2014 |
# ? Jul 19, 2014 00:41 |
|
Shaggar posted:this is a pretty decent example: no don't async makes functions slower due to an implicit state machine so only use it if u need to use await also it's usually better to split validation and async body to allow for fast failure
|
# ? Jul 19, 2014 00:42 |
|
but otherwise go hog iwld and watch the debugger attempt to keep up with that poo poo
|
# ? Jul 19, 2014 00:44 |
|
Microsoft says 2 use async for everything and newer versions mvc are all async
|
# ? Jul 19, 2014 01:38 |
|
wish your posts were async and lazily evaluated so i could choose to never await them!
|
# ? Jul 19, 2014 01:40 |
|
prefect posted:i think resharper wants you to use var by default actually they admitted that it was a mistake and never intended to be on by default but I do like var anyway so it's all good
|
# ? Jul 19, 2014 01:48 |
|
coffeetable posted:and while checking that i got the names right for those, ive just spotted Seven Concurrency Models in Seven Weeks which is deffo going on my reading list http://pragprog.com/book/pb7con/seven-concurrency-models-in-seven-weeks oh god this is a real thing here are some real concurrency models - share everything and hope your locks work but they won't because you're an idiot - share nothing, but oh no ~latency~ from copying poo poo who cares, get it working first and then try and build a broken locking version
|
# ? Jul 19, 2014 02:43 |
|
coffeetable posted:and while checking that i got the names right for those, ive just spotted Seven Concurrency Models in Seven Weeks which is deffo going on my reading list 88 bugs in 44 threads
|
# ? Jul 19, 2014 03:00 |
|
fritz posted:88 bugs in 44 threads 8bs48nigt hrdsea4u
|
# ? Jul 19, 2014 03:25 |
|
tef posted:- share nothing, but oh no ~latency~ from copying poo poo who cares, get it working first and then try and build a broken locking version or just avoid the copies and declare "hell be upon ye who shall modify thy messages after ye send"
|
# ? Jul 19, 2014 04:29 |
|
Kevin Mitnick P.E. posted:or just avoid the copies and declare "hell be upon ye who shall modify thy messages after ye send" this is just a really biblical way to describe the first system: quote:- share everything and hope your locks work but they won't because you're an idiot
|
# ? Jul 19, 2014 06:47 |
|
"hell be upon ye who shall... " rules fall down the day you make a new hire. expecting people to suss out and then observe convention is a terrible way to build software you either enforce your invariants or you have none
|
# ? Jul 19, 2014 06:47 |
|
the old man told me to make it const... i didn't listen
|
# ? Jul 19, 2014 07:03 |
|
Malcolm XML posted:no don't this is premature optimisation and bad advice imo, chances are that being buggy is way worse than being a little slower
|
# ? Jul 19, 2014 10:25 |
|
tef posted:http://pragprog.com/book/pb7con/seven-concurrency-models-in-seven-weeks - eh? what's a concurrency model? i just rerun the tests
|
# ? Jul 19, 2014 11:53 |
|
Shaggar posted:Microsoft says 2 use async for everything and newer versions mvc are all async AlsoD posted:this is premature optimisation and bad advice imo, chances are that being buggy is way worse than being a little slower no its basically: do u need to use await in the method? slap async otherwise return the task directly and ur method is still awaitable by an async method if u need to use await more than once or need to do processing on the result of a task use async it's a very specific but pretty common thing but it helps debugging like u have code:
|
# ? Jul 19, 2014 13:28 |
|
AlsoD posted:this is premature optimisation and bad advice imo, chances are that being buggy is way worse than being a little slower the compiler will bitch at u about async with no awaits and its for exactly this reason
|
# ? Jul 19, 2014 13:29 |
|
just checking: does setting variables from config files always look kind of crap? i've got a load of fields and a big stream reader method setting them one by one as it goes through the file
|
# ? Jul 19, 2014 16:00 |
|
pointsofdata posted:just checking: does setting variables from config files always look kind of crap? i've got a load of fields and a big stream reader method setting them one by one as it goes through the file
|
# ? Jul 19, 2014 16:02 |
|
|
# ? May 27, 2024 04:54 |
|
pointsofdata posted:just checking: does setting variables from config files always look kind of crap? i've got a load of fields and a big stream reader method setting them one by one as it goes through the file isn't there something that just sucks up a config file and gives you a data structure? i like that kind of thing
|
# ? Jul 19, 2014 16:03 |