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
are you bored of programming?
by Daniel Molina Wegener on 2011.11.25posted in: development, programming, projects, tips
Are you bored of programming?. Probably you are not in the proper job. But, what is programming? Take the following basic definition as “the process of designing, writing, testing, debugging, and maintaining the source code of computer programs”. So, the next natural question is what is a computer program? A computer program is “a sequence of instructions written to perform a specified task with a computer”. But programming is not about throwing instructions as you think about them, it is not that easy, they must be placed in a logical sequence, something with a real meaning in the language that your are programming, so it requires a good knowledge of the platform and environment.
impressions on hlint
by Daniel Molina Wegener on 2011.11.24posted in: development, haskell, programming, tips
I have worked with various static analysis tools, but the first time that I have worked with hlint, the Haskell static checker, I was impressed because it has suggested me a η-reduction. What is a η-reduction?, in simple words it finds λ equivalences between expressions, reducing function call sequences to less functions. The most classic reduction is the identity combinator reduction, where a function with the form (λxyz.(x)yz)(λrs.t)mn can be reduced just to the function application t.
php is almost a toy language for me
by Daniel Molina Wegener on 2011.11.23posted in: development, programming, projects, tips
As you know I am leaving PHP development — at least I have only one PHP project in my hands — and PHP as language now is almost a toy language for me. The reason is the fact that there is a lack of good tools to work with it and good programmers interested on PHP. For example it lacks good programmers, good enough to build open source static checkers, style checkers, PHP compilers to other languages, optimizers and related stuff. As community, seems that each project has its own styling rules, naming conventions and coding standards.
programming practice, 1991-b, part 2
by Daniel Molina Wegener on 2011.11.21posted in: development, haskell, programming, tips
I have solved this problem in a past post. Now I was able to visualize the solution using OpenGL in the small Haskell application. OpenGL under Haskell looks nice, easy to handle and very friendly to be used in a functional way. I don’t knew that OpenGL was using a Matrix from -1.0 to 1.0 for x, y and z coordinates. The main function has changed a little, so we can review how it works now as follows:



