suave

member.max 这样的 counter 应用是不是有 race condition 问题?

  •  
  •   suave · Aug 16, 2010 · 5359 views
    This topic created in 5750 days ago, the information mentioned may be changed or developed.
    看到 member signup 的时候 num 字段是用 Counter 中的 member.max & member.total 来计算的。

    访问量大的时候,两人在一个时间片段内同时请求,会得到相同的 member.max,进而获得相同的 num 值

    是不是有问题?
    1 replies    1970-01-01 08:00:00 +08:00
    Livid
        1
    Livid  
    MOD
    PRO
       Aug 16, 2010
    1. 目前还不会到那么大的量,加了 reCAPTCHA 之后就更不可能。

    2. GAE 支持 transaction,不过目前我承认我还没弄明白。

    3. datastore 在创建一个新用户时候的一系列读写操作可能会用掉数百毫秒,是最大的问题。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3747 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 04:55 · PVG 12:55 · LAX 21:55 · JFK 00:55
    ♥ Do have faith in what you're doing.