167 reputation
6
bio website tahapaksu.com
location Istanbul
age 30
visits member for 2 years, 6 months
seen Aug 21 at 5:19

electronics engineer, Classic ASP, PHP >= 4, ASP.net, C#, VB6, mySQL, MSSQL, HTML5, CSS3, jQuery, PIC mCU etc. programmer.

My PHPClasses Repository

My Web log

My last.fm page

Zend Certified PHP 5.3 Engineer


Dec
21
accepted design for interruptable operations
Dec
21
comment design for interruptable operations
I found out that java has a nearly same approach too. Thread.Start() creates a new thread and runs the code there, Thread.Run() just executes that code async in the same thread (stackoverflow.com/questions/3027495/…). I wonder why C# doesn't support that.
Dec
21
comment design for interruptable operations
Interesting. Ok, I don't know much about async processes, but does it run on the same thread? is it blocking other code? I mean, does the stack wait for the line to finish to execute further?
Dec
21
comment design for interruptable operations
Thanks for the dofactory link, it will be a good source for me, and observer/state design patterns fit for this situation while they are not really different from repeated flag checks on implementation. And of course there must be a rollback code when going back to idle.
Dec
21
comment design for interruptable operations
if you do the 4. action you mentioned, there is no need for scheduling, using timers or loops. That's what I've mentioned in the question and looking for some different approaches.
Dec
21
comment design for interruptable operations
Yes, I mentioned that in my questions bottom part as pseudocode as you can see. I'm looking for alternative patterns. And the question is clear enough as you can see by reading other answers.
Dec
21
comment design for interruptable operations
You would also need to use a event run flag to run events once. The real problem is that you let the process to complete while the power down, but it won't complete and cause you errors in some cases. The main reason I asked this to stop where the interrupt occurs no matter what, and if necessary run a rollback procedure, and then return to idle state.
Dec
21
comment design for interruptable operations
All answers use threads to apply this scenario. I wonder if there's something else. I'll wait some more before I accept a correct answer. I hope you all will understand.
Dec
20
comment design for interruptable operations
Threading is the most common option here then. I assume task is another way to describe a threaded process.
Dec
19
comment design for interruptable operations
Yes, running seperate threads is an answer in this situation, but not always. What if multithreading is not an option, how would someone return to idle state from a multi layered stack? I mean a calls b, then b calls c, how would someone exit directly from c to idle state?
Dec
16
comment design for interruptable operations
Ok, let's talk for C#/.Net Framework for example.
Dec
16
accepted User input and automated input separation
Dec
15
asked design for interruptable operations
Apr
14
awarded  Commentator
Apr
14
comment Application that provides unique keys to multiple threads
if you are using windows, you can use windows registry too.
Apr
14
comment Application that provides unique keys to multiple threads
are you using a database or will you use a database as a buffer? or a file? you can check the uniqueness with that file.
Mar
26
comment Using “prevent execution of method” flags
Ok, but it's a variable control instead of method call at first method. At second, both method call and variable control is executed.
Mar
26
awarded  Scholar
Mar
26
accepted Using “prevent execution of method” flags
Mar
26
comment Using “prevent execution of method” flags
Now I got that. "If you have no money, why did you enter the market?" right?