t_dictionary drop keys

Jun 21, 2012 at 10:47am

t_dictionary drop keys

Hello,

Sometimes my t_dictionary lose a bunch of keys without any apparent reason ; i’m pretty sure that it occurs when i add one other key, but i do absolutely nothing with those that disappeared ; anybody have experienced something like that ?

i know that it is not easy to answer to such vague question ; but i’m not able to reproduce the intermittent behavior and consequently to solve the bug ; any clue appreciated.

(max 5.1.9 / SDK 5.1.7)

#46079
Jun 21, 2012 at 5:17pm

Hello,

i should have said that this dictionary can be used in callback function in a custom POSIX thread …

1./ Is the dictionary thread_safe in this case ?
2./ Is there any reason not to use such a dictionary in a custom thread ?
3./ Do i have to lock it myself ?

#165994
Jun 22, 2012 at 6:01am

Hello,

Dictionary before the magic trick :

...

"fontname" : "Arial",
"numinlets" : 1,
"fontsize" : 14.0,
"numoutlets" : 4,
"outlettype" : [ "list", "", "bang", "bang" ],
"id" : "obj-1",
"tralala" : {
    "restore" : 						{
        "velocity" : [ "velocity", 0 ],
        "channel" : [ "channel", 1 ],
        "cell" : [ "cell", 12 ],
        "pattern" : [ "pattern" ],
        "zone" : [ "zone", 0, 96, 60, 71 ],
        "bpm" : [ "bpm", 240 ],
        "chance" : [ "chance", 100 ],
        "chord" : [ "chord", 0 ],
        "value" : [ "value", 12 ],
        "scale" : [ "scale", "C", "none" ],
        "0" : [ "note", 0, 64, 80, 12, 0 ],
        "1" : [ "note", 12, 66, 80, 12, 0 ],
        "2" : [ "note", 24, 66, 80, 12, 0 ],
        "3" : [ "note", 36, 60, 80, 12, 0 ],
        "4" : [ "note", 48, 60, 80, 12, 0 ],
        "5" : [ "note", 60, 62, 80, 12, 0 ],
        "6" : [ "note", 72, 62, 80, 12, 0 ],
        "7" : [ "note", 84, 64, 80, 12, 0 ]
    },

    "current" : 						{

    }
}

Dictionary after the magic trick :

"numoutlets" : 4,
"outlettype" : [ "list", "", "bang", "bang" ],
"id" : "obj-2",
"tralala" : 					{
    "restore" : {
        "0" : [ "note", 0, 66, 80, 12, 0 ],
        "1" : [ "note", 12, 66, 80, 12, 0 ],
        "2" : [ "note", 24, 60, 80, 12, 0 ],
        "3" : [ "note", 36, 60, 80, 12, 0 ],
        "4" : [ "note", 48, 62, 80, 12, 0 ],
        "5" : [ "note", 60, 62, 80, 12, 0 ],
        "6" : [ "note", 72, 64, 80, 12, 0 ],
        "7" : [ "note", 84, 64, 80, 12, 0 ]
    },

    "current" : 						{

    }
}

And sorry to think out loud ; but that’s two days i’m working on it ;-)

#165995
Jun 28, 2012 at 2:51pm

Sorry, just a stupid error in my code…

#165996

You must be logged in to reply to this topic.