Timeline for Flow Task Scheduler
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 23, 2017 at 12:41 | history | edited | CommunityBot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Aug 12, 2014 at 10:34 | comment | added | Danial Eugen | @Heslacher but i want him to see the updates i made how can i do that ? | |
Aug 12, 2014 at 10:20 | comment | added | Danial Eugen | updated the class can you take a look on it now ? | |
Aug 12, 2014 at 9:42 | comment | added | svick |
@DanialEugen And the thread-safe solution for using List is to use a lock, I already said that twice. Also, no, you can't use Count or any other member of List without a lock, none of the members of List are thread-safe.
|
|
Aug 12, 2014 at 9:40 | comment | added | svick |
@DanialEugen Not necessarily. You could move just JobTriggered() and not JobException() , if that makes the most sense for you.
|
|
Aug 12, 2014 at 9:25 | comment | added | Danial Eugen | and then every job handle will be standalone which will be kinda sick handling exceptions and so on that having everything in one place right ? | |
Aug 12, 2014 at 9:24 | comment | added | svick |
@DanialEugen I don't understand, you're not “subscribing” to JobTriggered , you call it. So instead of JobTriggered(job) , you would call job.JobTriggered() .
|
|
Aug 12, 2014 at 5:17 | comment | added | Danial Eugen | ah sorry and can you point me to a thread safe solution for the list prob because from what i see List and Thread Safe don't mix :P | |
Aug 12, 2014 at 4:08 | comment | added | Danial Eugen | also does _jobs.Count count for thread-safety ? or i can use it without lock | |
Aug 12, 2014 at 3:42 | comment | added | Danial Eugen | ok that makes sense... Also the reason i made the JobTriggered method a part of the scheduler and not the job is that i want to subscribe to it only one time and not subscribing every time i add a new job ? what about that | |
Aug 11, 2014 at 18:51 | comment | added | svick |
@DanialEugen You're accessing _jobs from two threads (the one that executes ProcessJobs() and the one that executes AddJob() ), and the accesses can happen at the same time. And since List<T> is not thread-safe, your code is not thread-safe. The simplest way to fix that is to access _jobs always under a lock, so that the accesses from different threads can't happen at the same time. In general, you might want to learn more thread-safety if you want to build multi-threaded applications.
|
|
Aug 11, 2014 at 18:33 | comment | added | Danial Eugen |
Well some explanations, 1- by saying DataFlow like i was pointing out to the whole thing not the statement behind it only. 2- As i run in trouble using async i just used Wait() as it does the same as i want (which is not executing a job before the other (the dataflow thingy). 3- I don't understand the first part about thread safety so can you be more accurate with some code examples ?
|
|
Aug 10, 2014 at 11:52 | history | answered | svick | CC BY-SA 3.0 |