Ideone.com now, again, with async support

finally Ideone.com got its thread support back again!

Something like this would have failed a week ago
http://ideone.com/RGYJps

#include <iostream>
#include <thread>

using namespace std;
int main() {
   auto func = [](string input)  {
      cout << input << ", from " << __FUNCTION__ << endl;
      };
   
   func("non threaded");
   auto id = thread(func, "from thread");
   id.join();
   return 0;
}
Posted in Uncategorized | Leave a comment

The world’s fastest logger vs G3log

Why not take the world’s fastest logger and compare it to G3log.  It’s a fun comparison and might show some PRO and CONs with each.

This comparison will show that being the world’s fastest logger is not good enough when it comes to latency. G3log wins hands down.

Does it sound like a contradiction? It’s not. Read on …

Continue reading

Posted in Uncategorized | 1 Comment

BitBucket no more, G3log has moved to GitHub

if you go to https://bitbucket.org/KjellKod/g3log you will be greeted by a “we have moved” sign 

 

G2log, the idea try-out G2log-dev and finally G3log all used mercurial and resided at BitBucket. Yesterday that changed. G3log resides solely on GitHub from now and the foreseeable future.

An email to all(*)  repository watchers and forkers explained briefly where G3log had moved.

(* for private watchers and forkers I had no “send message” option. I still see their username so why BitBucket made it impossible for me to contact them while still showing that much information is a mystery to me)

Professionally I have had much more experience with Git than Hg. The appeal in Git with ease of dealing with branches, pull requests and conflicts contrasted sharply with Hg’s multiple head madness. Finally it made me create a G3log mirror on GitHub a while ago. All of a sudden pull requests and dealing with feature requests became so much easier.

(Git does exist on ButBucket as well but BitBucket is lacking in other areas that I find important.)

Take with that revelation also greater community support and, to me, better support to requested features made it easy to take the decision to completely switch over to GitHub.

For now g2log and g2log-dev will continue to reside on BitBucket. Those two repositories rarely see code changes except for an occasional bugfix or compiler support fix requested by a user.

Moving G3log to GitHub will hopefully mean that it’s easier to access it for the community as well as contribute to it than it was on BitBucket.
Next on the TODO list for G3log are some long pending improvements to crash handling, lready now in large rolled out for Windows. Also easier install (first out Linux) and some small improvements to existing features are planned.

Posted in Uncategorized | Leave a comment

G3log now available on GitHub: github.com/KjellKod/g3log

Thanks to popular request you can now find g3log on GitHub as well as on BitBucket.
Feel free to use whichever repository is best for you.

Use github.com/KjellKod/g3log or bitbucket.com/KjellKod/g3log (it’s moved to be only at github)

Posted in Uncategorized | 2 Comments

Is it possibly to get a stacktrace to file from a signal handler?

I got a great question from a reader of the g2log article on CodeProject regarding g2log’s implementation of a crashhandler.

[…]new, delete and IO operations are not safe in signal handlers and could cause unpredictable behavior. I checked your implementation and maybe I am wrong but it seems this is exactly what you did (write to file/ empty queue within the signal handler). Is that by design, am I wrong or you missed this.

Of course the reader was completely right.   It is not safe, it is one of those “please don’t try this at home” kind of things.  With “safe” I here mean, “Posix guaranteed safe“.

Is there any “safe” way at all of getting the stacktrace to file after a fatal signal has happened?

Continue reading

Posted in Uncategorized | Leave a comment

G3log: Asynchronous logging the easy way

It is my privilege to present g3log, the successor of g2log that has been brewing since the creation of the g2log-dev.
G3log is just like g2log a “crash-safe asynchronous logger“. It is made to be simple to setup and easy to use with an appealing, non-cluttered API.
G3log is just like g2log blazing fast but with approximately 30% or faster LOG processing. G3log adds some important features:

  1. Completely safe to use across libraries, even libraries that are dynamically loaded at runtime
  2. Easy to customize with log receiving sinks. This is the major feature of g3log compared to g2log as it gives the users of g3log the ability to tweak it as they like without having to touch the logger’s source code.
  3. G3log provides faster log processing compared to g2log. The more LOG calling threads, the greater the performance difference in g3log’s favor.

G3log is just like g2log released as a public domain dedication. You can read more about that here: http://unlicense.org

So, don’t let slow logging bog your performance down. Do like developers, companies and research institutes are doing all over the globe, use g3log. Want to know more? Read on …

Continue reading

Posted in Uncategorized | 2 Comments

Concurrency : concurrent<T> part 2

concurrent<T> part I described a powerful wrapper that made all calls to the object to be executed asynchronously and in FIFO order. Using a lambda call made it easy to bundle several actions on the concurrent<object> in one asynchronous operation.

This is great news for coders who wants a foolproof background threaded object that manages well initialization, shutdown and with a thread-safe call API. No more start-up races or weird shutdown behaviour!

Sutter’s concurrent<T> is a powerful pattern. With some small changes and g3log tech import, we can boost it to be even better. Let’s make it foolproof to use, easier to call and with the power to handle derived types and not only concrete types.

Let’s take a step towards making concurrency as easy as we want it to be. At the same time let’s take a look at how std::packaged_task, std::future and std::exception_ptr are glued together to make this work great as well as being coder-user-friendly.

The finished and improved concurrent<T> can be found at:
github.com/KjellKod/Concurrent

Continue reading

Posted in C++, concurrency, Software Engineering | 1 Comment