86 karma · joined August 29, 2015
I work in a web dev shop and nearly everyone here uses Firefox as their main dev browser. We do run tests on other browsers as well but we mainly develop with Firefox and its tools.
Although part of the reason could be that we know most of our customers use it instead of Chrome. Don't ask me why, but if I had to venture I'd guess it's because Firefox is quite popular in my country for some reason.
To understand it better here's the solution to the producer/consumer problem (from wikipedia), using mutexes and semaphores:
mtx buffer_mutex;
sem fillCount = 0;
sem emptyCount = BUFFER_SIZE;
procedure producer()
{
while (true)
{
item = produceItem();
down(emptyCount);
down(buffer_mutex);
putItemIntoBuffer(item);
up(buffer_mutex);
up(fillCount);
}
}
procedure consumer()
{
while (true)
{
down(fillCount);
down(buffer_mutex);
item = removeItemFromBuffer();
up(buffer_mutex);
up(emptyCount);
consumeItem(item);
}
}
and the same problem solved using CCRs: int avl = 0;
procedure producer()
{
while (true)
{
item = produceItem();
region R when (avl < BUFFER_SIZE)
{
putItemIntoBuffer(item);
avl++;
}
}
}
procedure consumer()
{
while (true)
{
region R when (avl > 0)
{
item = removeItemFromBuffer();
avl--;
}
consumeItem(item);
}
}
The most important thing about CCRs is that they are supposed to guarantee fairness, along with mutual exclusion. A well-designed solution uses two binary semaphore queues to achieve this.If anyone wants to see what an implementation looks like here's a small C library I wrote a while ago, to use for some of my own personal projects, and to solve some homework for Uni https://github.com/Gikoskos/libccr
Only possible drawback is that they might perform worse than the alternative, at least in some cases.
Moreover, if you guys haven't read it yet you should definitely check out Raymond Chen's Old New Thing, which talks about the reasoning behind some of the design choices that went down in earlier Windows desktops.
Never having programmed in Gtk, what is the cause of this? Is Gtk broken or are all the programmers using it incorrectly? I've programmed a great deal in WinAPI and stuff like that never happens.
This is what my editor(Kate) looks like, is this a good font or a bad font? http://i.imgur.com/QtP1csu.jpg