음.. 어쩌다가 내 블로그가 이쪽 방향으로 흘러가는지 모르겠지만서도.. ^^

오늘은 무엇을 했냐하면..
fork 방식의 게이트웨이를 thread 방식으로 전환하면서
기존 라이브러리에서 데이터 파싱에 오류가 생겼다.

분명 입력한 데이터는 동일한데
처리를 못하겠다고 에러를 내 놓는거다.

로직을 따라따라 가다보니 strtok 가 문듯 의심스러워보인다.
언제나처럼 구글링을 감행...

strtok는 쓰레드에 안전하지 않다고 하네.
하긴 그냥 보기에도 그렇지.
두번째 파싱할때부터 인자로는 NULL 을 쓰는데 그건 내부적으로 뭔가 저장하고 있다는거 아니겠어.
이런건 닥치기 전까지는 생각못하는 것들이지..

그래서 기존 strtok 를 strtok_r 로 변경했다.

참.. string.h 이건 항상 중요하다.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void main()
{
    char    *token, *ptr, *last;
    char    seps[] = ",";
    int token_count;
    char *pszMessage = "SIMPLE,LIFE,IS,BEST";

    token_count = 0;
    token = strtok_r(pszMessage, seps, &last);
    while ( token != NULL )
    {
        printf("STEP [%02d][%s]\n", token_count, token);
        token = strtok_r(NULL, seps, &last);
        token_count++;
    }
}


크리에이티브 커먼즈 라이센스
Creative Commons License
2008/06/04 18:50 2008/06/04 18:50

Trackback URL : http://simplelife.pe.kr/tc/trackback/549

  1. Custom Foot Orthotics in Santa Monica

    Tracked from Custom Orthotics near me 2018/08/22 00:47 Delete

    끄적거림의 자유로움 :: strtok 는 thread-safe 하지 않다. 대안은 strtok_r 을 사용.

  2. i.ytimg.com

    Tracked from Culver City Custom Orthotics 2018/08/24 12:44 Delete

    끄적거림의 자유로움 :: strtok 는 thread-safe 하지 않다. 대안은 strtok_r 을 사용.

  1. # Flat Irons 2018/08/23 17:20 Delete Reply

    Healthy competition among various manufacturers of styling products makes
    it possible for ladies to get a wider range of products to choose from.
    There are numerous reliable sites out there that offer stylers
    at super discount rates. Asymmetrical styles are also great option designed for Asian women that goes well making use of their facial features.

  2. # Primaxusa.org 2018/08/23 22:59 Delete Reply

    If you're fitness enthusiast, you're no stranger to elliptical machines.
    Assistance as soon as the sale for consumers who did experience difficulty putting the Esprit by Spirit EL-5 Elliptical Trainer together needs
    improvement likewise. Through the machine's integrated interface,
    it's possible to program it for your using multiple people.

  3. # Andreas 2018/08/23 23:41 Delete Reply

    With the level set and operating you can easily
    check the heights of footings as well as other constructions throughout the site.
    This is useful in surveying and in some artistic work,
    most people won't use this feature. There are portable tripod models which are more affordable than standalone
    models that are desired by the normal homeowner.

  4. # best deal on treadmill 2018/08/24 08:39 Delete Reply

    65 Treadmill can be compared in pros and cons towards the Pro
    - Form model. One of the things that can be a challenge in regards tto
    the assembly is that you can actually tighten the
    bolts too much. The running deck floats - located on elastomer rings cushioning your impact.

  5. # Laser Distance Meter 2018/08/24 14:44 Delete Reply

    Imagine being forced to hang a ceiling with no knowledge of the complete level or whether you get
    it slope down a single corner. And the best part is
    they won't break your budget - laser tools are affordable and will be found
    as discount tools. There are two types that dominate
    the market today, a tripod mounted unit is more expensive, however when looking
    at accuracy, it cannot be beat.

  6. # discount electric shavers 2018/08/24 19:55 Delete Reply

    Having the electric shaver repaired additionally
    it iss super easy because it may be submitted and returned in very little time at all.

    This shaver could be commonly grabbed at under $15 and also at that price you have a great deal of shaver for your money.
    There are some shavers wherein the razors could be manually
    removed and cleaned with plain water.

  7. # Relevant Rankings 2018/08/25 00:02 Delete Reply

    There's nothing worse than finding a new sofa or curtains to find they don't fit so
    keep a tape measure handy with your tool box.
    This allows, if desired, someone to set everything in a region to a specific angle.

    Easy to use giving, which may offer you a good way of attaining your target.

  8. # Best Treadmill Under $300 2018/08/25 06:14 Delete Reply

    Always attempt to set an allowance for your equipment so that you
    can be capable of find the the one which it is possible to afford.
    Some treadmills put the speed and incline options directly into the handrails.
    This may cause muscle and joint aches, over-exertion of the virgin pressure point
    may cause harm to ligaments and tendons which can bee extremely painful and might lead to temporary disability.

  9. # bushnell medalist golf rangefinder 2018/08/25 10:55 Delete Reply

    And you can find a large number of reviews over the internet which shows that a fairly large number of golfers utilize this magicaal device.
    This will be very helpful and you will have the opportunity
    to turn into a better golfer. Today, the most effective players in addition to their caddies
    are still using laser rangefinders in their pre-tournament preparation, as opposed
    to GPS, that is popular with recreational golfers.

  10. # DEWALT DW079KDT Review 2018/08/25 15:39 Delete Reply

    With the amount set and operating you can actually look at the
    heights of footings along with other constructions around the site.

    This allows, if desired, you to set my way through a place
    with a specific angle. Pliers - This essential tool
    is wonderful for any project that requires you to definitely cut, bend, grip or strip wire.

  11. # Flat Iron Reviews 2018/08/25 18:00 Delete Reply

    Storing - For safety and to avoid the possibility of a hearth,
    enable the styler for cooling completely before storing.
    Secondly, go with a model that includes titanium or ceramic plates
    with ceramic tourmaline heaters. Nothing matters higher than a positive first impression; which is why the Herstyler Flat Iron will forever top the lists of an woman's
    beauty tools.

  12. # Alabama crimson tide 2018/09/15 04:09 Delete Reply

    This is really fascinating, You are an excessively skilled blogger.
    I have joined your feed and look forward to looking for more of your great post.
    Also, I have shared your site in my social networks

  13. # minecraft 2018/09/23 05:15 Delete Reply

    For the reason that the admin of this site is working, no uncertainty
    very quickly it will be famous, due to its quality contents.

Leave a comment

« Previous : 1 : ... 114 : 115 : 116 : 117 : 118 : 119 : 120 : 121 : 122 : ... 504 : Next »

뚜는 지금.. 사랑해사랑해
아.. 열심히 살자..
남자B형염소자리인천

Categories

전체 (504)
뚜.. 서툰.. (258)
폰 이야기 (13)
나의 길 (85)
읽을거리 (21)
사진갤러리 (124)

Recent Posts

  1. Android Studio 2.2 에서 layout 미리...
  2. mac 에서 ssh 접속시 한글 입력이 안될때.
  3. Android Studio. Zxing 라이브러리 사...
  4. 안드로이드 프로젝트를 SVN 등록시 bin...
  5. 안드로이드에서 android.annotation 를...

Recent Comments

  1. If you don't have a list you are in ... 3win8 apk 04:43
  2. Ultimately your blog is the funnel m... live22 casino 09/24
  3. Lyndia is the place I'm called but d... online poker dealer 09/24
  4. Hi my friend! I want to sayy that th... runescape 2007 gold 09/24
  5. Thanks to my father who told me abou... minecraft 09/24

Recent Trackbacks

Bookmarks

  1. ATOMOS
  2. c3cc3's Homepage
  3. 봄실
  4. 우중산보... 그 싱그러운 여유

1243

675

google chart api graph

-30 days

today : 213

Site Stats

TOTAL 627100 HIT
TODAY 213 HIT
YESTERDAY 842 HIT