How can you write good multi-threaded code without using
condition variables?
On most flavors of unix you have the pthread api which gives you
pthread_cond_t structures and the related API functions. However
on all version of Windows before Windows Vista and Windows Server
2008, the Windows API's did not come with any kind of condition
variables. This makes it really hard to write multi-threaded code
that works on both Windows and Unix systems especially if you
want the code to behave in a similar way on all platforms.
Well Mysql developers solved this issue by writing their own
version pthread_cond_t and related functions which can be found
in the codebase in the files my_wincond.c. The code is #ifdef
enabled on Windows platforms otherwise the standard pthread api
is used. The implementation of condition variables in the mysql
code base utilizes one CRITICAL_SECTION variable, and 3 arrays of
Windows' Event objects. The …
Like a number of other Sun people, whether MySQLers or not, I will travel to Brussels next weekend, for FOSDEM ‘09, an acronym which stands for the Free and Open Source Software Developer’s European Meeting.
If you think you’re late in registering, or if you don’t have a budget, don’t worry. Entrance is free, and registration isn’t necessary. “Just come to the campus and enjoy the conference”, the FOSDEM site stresses.
As for MySQL, we have a developers room on Sunday as follows:
Sun 09:00-10:00 | … |
I was looking for some info on liveblogging art this am because I never did a similar activity and was wondering if I am able to do it in the next confs I’m gonna taking.
Liveblogging means taking notes about a conference session you are listening and share the main concepts of the talk with people who are not present in the room.
I’ve found some tips on how to start a successful liveblogging session and tested a cool platform: http://www.coveritlive.com.
You know, liveblogging at a conference is very important for people who can’t attend it. It helps, among with pics and videos, to smell the great atmosphere you can breathe in a community event.
I think things are evolving well from this side.
If I am not mistaken, the most easy way to liveblogging is to create a short blog post during the speech and publish it at the conclusion of the …
[Read more]Hi,
SQLyog 8.0 is a major new version of SQLyog introducing major features like Query Profiler, SQL Formatter and vastly improved look and feel.
Query Profiler:
MySQL has always lacked the sophisticated profiling tools shipped with proprietary databases like SQL Server, etc. MySQL developers have largely depended on EXPLAIN for tuning queries. The SHOW PROFILE patch by Jeremy Cole was introduced in the MySQL Community version 5.0.37 and it provided much more insight into where the query spends its time. However, to take advantage of this feature, MySQL developers were supposed to switch on profiling, run their queries and then filter the profiling data from a table that contained the profiling results of the last few profiled queries. A lot of manual book-keeping is required to take advantage of …
[Read more]Have you ever been upset by the Linux tendancy to swap… Especially when trying to allocate a large InnoDB buffer pool.. Look at the following output:
yves@yves-laptop:~$ free
total used free shared buffers cached
Mem: 2041888 1991096 50792 0 52 954592
-/+ buffers/cache: 1036452 1005436
Swap: 975200 1308 973892
There is still 50792 + 52 + 954592 = 1005436 of free memory and Linux starts to swap!!! The reason is hidden here:
yves@yves-laptop:~$ cat
/proc/sys/vm/swappiness
60
The swappiness controls the Linux to swap for the File cache. For a file server or a web server or even MySQL with MyISAM tables, the file cache is interesting but for InnoDB or NDB Cluster it is close to useless. Only put a “0″ in that proc entry (echo 0 > /proc/sys/vm/swappiness) and add …
[Read more]I received an email from Tarus Balog, CEO of OpenNMS Group, on Friday, taking issue with the language I had used to describe two open source vendors (and I use that term deliberately).
Essentially Tarus objected to me using the term “open source vendor” to describe two companies with Open Core licensing strategies. His email raises a valid point about how we determine which companies are considered “open source vendors” and I wanted to use the opportunity to outline the rules I use to make that decision.
As a technical snafu at our end had prevented Tarus from leaving a comment on the blog I hope he won’t mind me using his words to explain the issue he raised.
He wrote:
“You …
[Read more]Some database engines have a fundamental concept of a row id. The row id is everything you need to know to locate a row. Common uses include secondary indexes (key is what’s indexed, value is rowid which you then use to lookup the row).
One design is the InnoDB method of having secondary indexes have the value in the index be the primary key of the row. Another is to store the rowid instead. Usually (or often… or sometimes…) rowid is much smaller than the pkey of the row. This is how innodb can answer some queries just out of the index. If it used rowid, it may involve more IO to answer the query. All this is irrelevant if you never want just the primary key from a secondary index.
Some engines are designed from the start to have rowid, others it’s added later (e.g. NDB).
Anyway… all beside the point. Did you know you can do this in mysql or drizzle:
drizzle> create table t1 (a int primary key); Query …[Read more]
MySQL Conference and Expo is coming up to Santa Clara this April. The program schedule is really easy to navigate and tells you about everything there's to partake of.
A quick review will show you that the quality of the
no-nonsense presentations will be amazing, and it will be a
true privilege to attend the conference. (We should thank
the MySQL community team for helping ensure this high level
of technical quality and relevance.) |
MySQL Conference and Expo is coming up to Santa Clara this April. The program schedule is really easy to navigate and tells you about everything there's to partake of.
A quick review will show you that the quality of the
no-nonsense presentations will be amazing, and it will be a
true privilege to attend the conference. (We should thank
the MySQL community team for helping ensure this high level
of technical quality and relevance.) |
I found out the hashing algorithm used in PHP-Memcache is different from that of Python-Memcache. The keys went to different servers as the hash created by python and php were different.
I posted a question on the memcache groups and was lucky to find this wonderful reply.
import memcache import binascii m = memcache.Client(['192.168.28.7:11211', '192.168.28.8:11211 ', '192.168.28.9:11211']) def php_hash(key): return (binascii.crc32(key) >> 16) & 0x7fff for i in range(30): key = 'key' + str(i) a = m.get((php_hash(key), key)) print i, a
This is the only thing that has to be done on Python's end, change the way the hash is calculated. The coding on PHP end remains same. All you guys using PHP for web based front-end with MySQL and Python for back-end scripts shall find this helpful.
Thanks Brian Rue.
Reference: …
[Read more]