Thursday, March 27, 2014

Dulce Maria Arizmendi


El 24 de Marzo de 2014 fallecio Dulce Arizmendi. Mi madre. Empresaria, escritora, aventurera. Fuerte. Misericordiosa. Fuente de amor intenso y de luz para nosotros los afortunados que la conocimos. 

Este es un poema que me escribio el dia que cumpli los 14. 

----------------------------------------
Estas dormido, me acerco
no quisiera despertarte
acaricio tu cabeza
pero casi sin tocarte
siento el aire, no asi el tiempo
que se pierde en el encuentro del momento
suave y tibio como en verano el viento
siento en la piel la caricia de tu aliento

- Dulce Arizmendi

Monday, January 07, 2013

Julen Arizmendi Campeón de España

If I recall correctly, the last time I played my brother I won...sometime in 1982. :-)


Thursday, March 23, 2006

Canceling Worker Threads


Here's an old post of mine on thread cancelation techniques. The message is a bit old but the conclusion still holds, I think. In short, the question is how does one cancel a worker thread. Here are some options from that post (slightly revised):

1) Asynchronous cancelation: The general consensus on comp.programming.threads is that this is bad. The target thread will be left in an indeterminate state and, if it was doing anything even remotely interesting, you'll likely experience resource leaks or crashes.

2) Deferred cancelation: Nice, standard way of going about cancelation but it suffers from some serious issues. First, target threads can still block in poll and select and conform to the POSIX standard (neither is on the list of cancelation points under POSIX 1996). Second, cancelation cleanup under pthreads and cleanup under C++ do not usually work together. On most platform/compiler combinations a canceled thread will execute pthread cancelation handlers but will not execute catch blocks or destructors for local objects.

3) Signals: This solution seems to work well but only under some rather strict guidelines - your library client should not use signals, should not create threads except via your library and should not make use of other libraries that create threads. However, if this suits you fine then cancelation using signals allows you to wake a thread stuck in a blocking call - errno will return EINTR - which your client's code can handle as it sees fit. If your client returns or throws in response to the failure C++ catch blocks and destructors will be called as expected.

Note: The standard (3.3.1.4 Signal Effects on Other Functions) has this to say about functions that are interrupted by signal handlers: "If the signal-catching function executes a return the behavior of the interrupted function shall be as described individually for that function". I guess this means that assuming the function will fail or that errno will return EINTR as a result of the failure may not be portable (although that's what you get on Linux).

4) Pipes or local sockets: IMO, the least intrusive solution of the bunch if you're code follows the reactor pattern. Your poll or select call includes a descriptor that is only used to wake it when the thread is to be canceled. This approach returns from blocked select and poll calls, works well with C++ but does nothing for you if your thread is stuck in anything other than select or poll. I've taken this approach for my reactor based code noting that clients should not make calls that take "too long".


Monday, June 27, 2005

Grokster Loses

Grokster and Streamcast lost today, but it looks like a win for P2P. Although today's decision squashes two very popular networks, it does so only because these networks were pretty open about the true intention of their software (copyright infringement). A quick reading of the opinion gives the impression that it might very well be Ok to distribute P2P software provided you market it as a general purpose tool (eg, BitTorrent).

It was nice to see how the Court pointed out that the lower court's opinion rested on an erroneous reading of Sony and left it at that. Rather than trying to settle the question for good, they issued a very narrow decision and left themselve's plenty of wiggle room for future decisions.

Thursday, March 03, 2005

Mastering the Najdorf

My brother and Javier Moreno recently finished a book (my brother's first), titled "Mastering the Najdorf". The content is rather cryptic (it's an advanced book on chess), so I just keep it on the shelf and page through it now and then (maybe hoping some of it will sink in subconsciously). Nonetheless, it's very cool to see my little bro's name on the binding.

Tuesday, January 04, 2005

US generosity

In his Monday post Juan Cole looks into the generosity of the contributions of Middle Eastern countries relative to the US (taking into consideration population and per capita income). His conclusion is that countries like Saudi Arabia are more generous than the US. However, I think he omits one very important difference. The US government contributes with authority granted to it by the US public (via elections), whereas the Saudi government for instance, contributes with no legitimate authority at all. The relatively few members of the Royal Family are giving away what they've basically snatched from their people. Comparing the per-capita contributions of two countries implies that the decision to contribute is itself "per-capita" (roughly speaking). In the case of Saudi Arabia or Libya it obviously isn't.

However, the simple analysis when applied to Australia and Turkey does seem to hold. But even in this case, the analysis is too simple. Comparisons of US contributions to those of other countries should consider ALL costs the US bears: operation of US naval vessels and aircraft involved in rescue operations, proportion of UN funding that comes from the US, contributions by private US organizations, US military costs that benefit other countries, etc.


Friday, December 10, 2004

What others think

Eugene Volokh hits the nail on the head. I'm pretty sure I've fallen into this trap myself. From this list it looks like this might be an example of "Unrepresentative Sample" (maybe they should add a category called "Assertions Pulled From Thin Air").