What is thread-safe?. Thread-safe implies that for a given resource it will not be used at the same time by two or more threads or processes. By resource, we must understand a memory block or similar kind of resources. If you create a list that is shared between threads to store data, you will need a way to write that list — appending nodes or removing nodes — without writing it simultaneously. This implies the usage of thread-safety techniques that will bring you sequential access to the list allowing sequential writes, instead concurrent writes that will probably crash your application.
web developer & system programmer
coder . cl
ramblings and rants on software development...
what is thread-safe?
by Daniel Molina Wegener on 2011.11.26posted in: c, development, java, programming, tips
evolutionary unit tests
by Daniel Molina Wegener on 2011.07.08posted in: development, haskell, java, programming, tips
Evolutionary development depends on continuous iterations with the customer, being a final customer or not, like an intern QA engineer. If you create unit tests in your evolutionary development process, you can also work with evolutionary unit tests. An evolutionary unit test can be used on code hardening tasks, because you must make your test fail using unexpected environment behaviour, for example passing null references to your unit tests, avoiding the well known “Null References: The Billion Dollar Mistake”, once the code is refactored to support null references.
considerations in code review
by Daniel Molina Wegener on 2011.07.06posted in: development, java, programming, python, tips
Once we have created code, we can evaluate how it was done. We can use various tools to check our creation among other activities. To do standard checks, we can use style checkers, static checkers, unit testing suites and the most important one, the human code review.
singleton are not dangerous
by Daniel Molina Wegener on 2011.06.30posted in: development, java, programming, tips
Yes, singleton patterns are not dangerous. That pattern is dangerous only for those developers that cannot handle concurrent programming or parallel programming, where you need to manage resources with concurrent access, even if they are read or write. There are some myths related to the singleton pattern, but they are just created by that kind of developers. If you don’t know about concurrent programming techniques, is obvious that your application is at risk if your are using singletons with the wrong implementation. Also it depends on how large is your application, how do you apply governance over you application design and which platform is using.
code hardening techniques
by Daniel Molina Wegener on 2011.02.23posted in: development, java, programming, tips
Do you know something about Test Driven Development?, It is OK, you can reach optimal development performance using TDD, and similar methodologies. You will find yourself developing applications very quickly, but “how hard is your code?”. You can reach very high quality code only using your debugger, making tests is just not enough. Using some debugging techniques, you can find not evident bugs, and you will probably find succesfuly some bugs that can cause your application to core dump — core dump is one of the ugliest forms of application failures, I prefer to think that each application failures is not another thing than a core dump.



