<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Comments for : C from erlang via linked-in driver</title>
    <link>http://www.chrisumbel.com/article/c_from_erlang_curl</link>
    <description>Comments about C from erlang via linked-in driver from the blog of Chris Umbel, software developer and database administrator.</description>
    <pubDate>2009-09-16 21:09:00 UTC</pubDate>
    <item>
      <title>Comment by: chrisumbel on 2010-08-06 12:04:44 UTC</title>
      <link>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c5bfa5c75fd7f3e43000008</link>
      <description>Michael, it was actually another poster who mentioned another project using libcurl.  I too am interested in knowing which project.

Starting to look like I need threaded comments around here:)</description>
      <guid>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c5bfa5c75fd7f3e43000008</guid>
      <pubDate>2010-08-06T12:04:44+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: cignos on 2010-08-03 03:06:51 UTC</title>
      <link>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c5787cb75fd7f0f16000027</link>
      <description>Hi, Michael,

Well, I searched the solution in Internet and as a matter of course, I found it is provided erlang thread wrapper version of blocking C functions, as in GNU pth, State Threads Library, etc.</description>
      <guid>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c5787cb75fd7f0f16000027</guid>
      <pubDate>2010-08-03T03:06:51+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: Michael on 2010-08-01 17:09:05 UTC</title>
      <link>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c55aa3175fd7f7c0200002e</link>
      <description>Hi cignos,

You note about blocking the OS thread is interesting.
How can we fix Chris's C code then?</description>
      <guid>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c55aa3175fd7f7c0200002e</guid>
      <pubDate>2010-08-01T17:09:05+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: Michael on 2010-08-01 17:06:36 UTC</title>
      <link>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c55a99c75fd7f7c0200002c</link>
      <description>Hi Chris,

You said: "I've heard of another project using libcurl with its erlang crawler". Which project is it?</description>
      <guid>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c55a99c75fd7f7c0200002c</guid>
      <pubDate>2010-08-01T17:06:36+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: cignos on 2010-07-23 08:07:41 UTC</title>
      <link>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf945313180400002c</link>
      <description>It seems that C I/O functions block OS thread rather than erlang process. So, concurrent application of eurl:curl() seems to be serialized. Running ex1:run() with large concurreny (M) and slow respnding URL (Url) in following code illustrate this problem. ("curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10);" in eurl.c kills Erlang VM on slow page due to timeout. So, running this test requires it disabled.)

-module(ex1).
-compile(export_all).

run(M, N, Url) -&gt;
    eurl:start(),
    spawn_testers(M, N, Url),
    receive _ -&gt; ok end.

spawn_testers(0, _, _) -&gt; ok;
spawn_testers(M, N, Url) -&gt;
    spawn(?MODULE, tester, [N, Url]),
    spawn_testers(M - 1, N, Url).

tester(N, Url) -&gt;
    io:format("Start tester: ~p ~p~n", [now(), self()]),
    tester_loop(N, Url).

tester_loop(0, _) -&gt; ok;
tester_loop(N, Url) -&gt;
    eurl:curl(Url),
    io:format("~p: ~p ~p~n", [N, self(), now()]),
    tester_loop(N - 1, Url).
</description>
      <guid>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf945313180400002c</guid>
      <pubDate>2010-07-23T08:07:41+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: Michael Terry on 2010-06-24 00:06:13 UTC</title>
      <link>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf945313180400002b</link>
      <description>Oh, sure, no problem. I was just curious. As a linked-in driver example, it's great, and actually more interesting to me than others I've seen.</description>
      <guid>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf945313180400002b</guid>
      <pubDate>2010-06-24T00:06:13+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: chrisumbel on 2010-06-23 04:06:19 UTC</title>
      <link>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf945313180400002a</link>
      <description>
eee, it's been a while and have had little reason to look at the crawler in months but I dealt with some kind of persistent failure (I realize that's not useful information:)) that exhibited itself with extreme parallelization (which is why I went to erlang in the first place).    

I also do recall mucking with ibrowse and ultimately dismissing it while prototyping the project for some reason or another.    

Maybe over the next week or so I'll dig through the project and see if I can refresh my memory.  Believe-you-me I'd love to keep that as pure-erlang as possible and, assuming it worked, I'd prefer a pure-erlang implementation.

Also, keep in mind the purpose of the article.  It's a description of how to write a linked-in driver in general, not http fetching.  The curl-based http fetch was just an example payload even if it turns out to be contrived.</description>
      <guid>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf945313180400002a</guid>
      <pubDate>2010-06-23T04:06:19+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: Michael Terry on 2010-06-22 00:06:46 UTC</title>
      <link>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf9453131804000029</link>
      <description>I've heard of another project using libcurl with its erlang crawler. Did you try ibrowse? Is there any theoretical benefit to libcurl over ibrowse (or any native erlang client, assuming it works)? How was the http module failing under pressure?</description>
      <guid>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf9453131804000029</guid>
      <pubDate>2010-06-22T00:06:46+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: chrisumbel on 2009-11-11 09:11:41 UTC</title>
      <link>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf9453131804000028</link>
      <description>Hey, thanks for the feedback.  You're certainly right about that.  Can't imagine I intended to leave it that way.  I'm certainly cleaning that up.</description>
      <guid>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf9453131804000028</guid>
      <pubDate>2009-11-11T09:11:41+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: Mazen Harake on 2009-11-06 09:11:54 UTC</title>
      <link>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf9453131804000027</link>
      <description>Nice intro, except for the 'noop' thing which is pretty ugly actually :) The rest was a really nice intro though. /Mazen</description>
      <guid>http://www.chrisumbel.com/article/c_from_erlang_curl#comment_4c4b2ecf9453131804000027</guid>
      <pubDate>2009-11-06T09:11:54+00:00</pubDate>
    </item>
  </channel>
</rss>
