Conversation with #inferno at Fri Aug 26 08:28:52 2011 on powerman-asdf@irc.freenode.net (irc) (08:28:52) barjavel.freenode.net: (notice) [freenode-info] if you're at a conference and other people are having trouble connecting, please mention it to staff: http://freenode.net/faq.shtml#gettinghelp (08:32:30) powerman-asdf left the room (quit: Ping timeout: 260 seconds). (09:25:07) bvalek2 [c3e41404@gateway/web/freenode/ip.195.228.20.4] entered the room. (09:54:36) robot12 [~kazzhilki@proxy10.ts.fujitsu.com] entered the room. (14:58:04) robot12 left the room (quit: Ping timeout: 245 seconds). (15:11:24) robot12 [~kazzhilki@proxy10.ts.fujitsu.com] entered the room. (15:27:51) bvalek2 left the room (quit: Quit: Page closed). (16:13:53) powerman-asdf: what do you think about idea to add native support for hash data type to limbo? (16:14:38) powerman-asdf: h := hash[17] of …; # 17 is hash size hint (16:15:12) powerman-asdf: h["key"] = val; (16:15:31) powerman-asdf: del h["key"]; (16:15:53) powerman-asdf: for(k := keys h; k != nil; k = tl k) (16:30:24) bvalek2 [c3e41404@gateway/web/freenode/ip.195.228.20.4] entered the room. (16:32:31) robot12 left the room. (17:05:18) Fish left the room (quit: Ping timeout: 240 seconds). (17:05:18) Fish [~Fish@exo3753.pck.nerim.net] entered the room. (17:36:51) anth_r [none@adsl-99-40-132-129.dsl.bcvloh.sbcglobal.net] entered the room. (17:58:56) mycrofti1 is now known as mycroftiv (18:09:15) vsrinivas: powerman-asdf1: why? the external hash table implementations are pretty decent. (18:09:55) powerman-asdf: probably because my brain is damaged by perl :) (18:10:32) powerman-asdf: I just feel wrong to use external module for this. (18:11:16) powerman-asdf: think this way: in C you use external module (libc functions) to get strings! but in limbo string is internal type (18:12:07) powerman-asdf: hash is similar to strings or lists because it's actually basic and very useful data structure (18:12:42) vsrinivas: no argument hash is super useful. but what would you get from having it internal? now its just a simple load statement extra... (18:13:05) vsrinivas: (if you can make it faster or denser or whatnot than you can in pure limbo go for it :) (18:14:10) powerman-asdf: yeah. but you also can implement lists manually too. and use "lists->hd(mylist)" instead of "hd mylist" (18:16:56) powerman-asdf: also, if hashes is internal type, then limbo may optimize statements like h["mylongkey"] by calculating hash function once for "mylongkey" string and use that calculated value as dis opcode param instead of calling hash function for that string each time this key accessed (18:25:07) vsrinivas: hmm, but: idx := hash("totallycoolkey"); would work tooo... (18:26:33) vsrinivas: no argument it'd be convenient :) (18:26:52) vsrinivas: in particular hashtab["foo"] is nicer than hashtab.get("foo") (20:34:20) Fish- [~Fish@9fans.fr] entered the room. (21:02:28) bvalek2 left the room (quit: Quit: Page closed). (22:38:06) bvalek2 [5062fd97@gateway/web/freenode/ip.80.98.253.151] entered the room. (23:22:18) vsrinivas left the room (quit: Read error: Connection reset by peer). (00:19:22) Fish- left the room (quit: Quit: WeeChat 0.3.5). (01:56:43) bvalek2 is now known as MrBond (02:00:14) MrBond is now known as DrEvil (02:05:27) DrEvil is now known as TheCheshireCat (02:07:27) TheCheshireCat left the room (quit: Quit: Page closed). (10:07:35) bvalek2 [5062fd97@gateway/web/freenode/ip.80.98.253.151] entered the room. (10:48:43) Fish- [~Fish@9fans.fr] entered the room. (11:48:22) Fish- left the room (quit: Quit: WeeChat 0.3.5). (13:04:46) Fish- [~Fish@92.90.16.21] entered the room. (13:22:27) Fish- left the room (quit: Ping timeout: 252 seconds). (14:37:40) Fish- [~Fish@92.90.16.49] entered the room. (17:04:36) bvalek2 left the room (quit: Ping timeout: 252 seconds). (17:05:59) bvalek2 [5062fd97@gateway/web/freenode/ip.80.98.253.151] entered the room. (19:44:14) Fish- left the room (quit: Quit: WeeChat 0.3.5). (19:44:30) Fish- [~Fish@92.90.16.49] entered the room. (22:04:23) Fish- left the room (quit: Quit: WeeChat 0.3.5). (22:06:00) Fish- [~Fish@bus77-2-82-244-150-190.fbx.proxad.net] entered the room. (23:51:38) bvalek2 left the room (quit: Quit: Page closed). (23:57:33) Fish- left the room (quit: Quit: WeeChat 0.3.5). (12:25:06) bvalek2 [5062fd97@gateway/web/freenode/ip.80.98.253.151] entered the room. (13:37:28) KBme left the room (quit: *.net *.split). (13:38:02) KBme [~KBme@2001:470:cabe:666:666:666:666:666] entered the room. (13:40:40) mycroftiv left the room (quit: *.net *.split). (13:40:44) KBme left the room (quit: *.net *.split). (13:40:45) anth_r left the room (quit: *.net *.split). (13:40:46) eno left the room (quit: *.net *.split). (13:40:46) uriel left the room (quit: *.net *.split). (13:40:47) bvalek2 left the room (quit: *.net *.split). (13:40:47) mjl- left the room (quit: *.net *.split). (13:40:47) yiyus left the room (quit: *.net *.split). (13:40:48) __20h__ left the room (quit: *.net *.split). (13:40:48) Fish left the room (quit: *.net *.split). (13:42:37) mycroftiv [~ircguy@h69-128-47-242.mdsnwi.dedicated.static.tds.net] entered the room. (13:42:37) KBme [~KBme@2001:470:cabe:666:666:666:666:666] entered the room. (13:42:37) bvalek2 [5062fd97@gateway/web/freenode/ip.80.98.253.151] entered the room. (13:42:37) yiyus [~124271242@je.je.je] entered the room. (13:42:37) mjl- [~none@berteun.nl] entered the room. (13:42:37) __20h__ [~some_one@r-36.net] entered the room. (13:42:37) uriel [~uriel@li43-28.members.linode.com] entered the room. (13:42:37) eno [~eno@nslu2-linux/eno] entered the room. (13:42:37) Fish [~Fish@exo3753.pck.nerim.net] entered the room. (13:42:37) anth_r [none@adsl-99-40-132-129.dsl.bcvloh.sbcglobal.net] entered the room. (13:45:20) anth_r left the room (quit: *.net *.split). (13:45:38) anth_r [none@adsl-99-40-132-129.dsl.bcvloh.sbcglobal.net] entered the room. (18:29:32) Fish- [~Fish@9fans.fr] entered the room. (18:36:04) powerman-asdf: another one annoying issue with external hashtable module: (18:36:56) powerman-asdf: if module A public interface include some function which have param (or return value) of type hash, (18:37:26) powerman-asdf: then any other module which 'include "A.m";' must also include hashtable's module (18:37:50) powerman-asdf: even if it doesn't use that part or module A's interface which works with hashes (21:11:42) powerman-asdf: is it possible to initialize new variable with user-defined type? eg.: (21:12:05) powerman-asdf: IntChan: type chan of int; (21:12:13) powerman-asdf: c: IntChan; # works (21:12:20) powerman-asdf: c := IntChan; # not works (21:13:16) powerman-asdf: go have new() for this, afair (21:15:27) powerman-asdf: I've 'chan of chan of list of array of byte' and wanna shorten it with user-defined type, but this don't have much sense if I can't create new variables using short type name. ☹ (23:51:30) bvalek2 left the room (quit: Ping timeout: 252 seconds). (00:24:37) Fish- left the room (quit: Quit: WeeChat 0.3.5). (09:34:13) robot12 [~kazzhilki@proxy10.ts.fujitsu.com] entered the room. (10:41:27) Fish left the room (quit: Quit: WeeChat 0.3.5). (10:44:16) Fish [~Fish@exo3753.pck.nerim.net] entered the room. (11:30:59) robot12 left the room (quit: Ping timeout: 245 seconds). (12:10:56) robot12 [~kazzhilki@proxy10.ts.fujitsu.com] entered the room. (13:02:22) bvalek2 [50bb961b@gateway/web/freenode/ip.80.187.150.27] entered the room. (18:55:08) bvalek2 left the room (quit: Ping timeout: 252 seconds). (20:06:30) bvalek2 [50bb972d@gateway/web/freenode/ip.80.187.151.45] entered the room. (20:47:44) Fish- [~Fish@9fans.fr] entered the room. (23:01:05) bvalek2 left the room (quit: Quit: Page closed). (00:20:06) Fish- left the room (quit: Quit: WeeChat 0.3.5). (12:23:58) bvalek2 [50bbc472@gateway/web/freenode/ip.80.187.196.114] entered the room. (14:01:20) bvalek2 left the room (quit: Ping timeout: 252 seconds). (14:09:09) bvalek2 [50bbc472@gateway/web/freenode/ip.80.187.196.114] entered the room. (17:08:02) robot12 left the room (quit: Quit: Leaving.). (17:42:48) bvalek2 left the room (quit: Ping timeout: 252 seconds). (17:43:12) bvalek2 [50bbc472@gateway/web/freenode/ip.80.187.196.114] entered the room. (17:58:48) Fish left the room (quit: Quit: WeeChat 0.3.5). (18:09:06) Fish [~Fish@exo3753.pck.nerim.net] entered the room. (18:27:02) bvalek2_ [50bbc472@gateway/web/freenode/ip.80.187.196.114] entered the room. (18:27:07) bvalek2 left the room (quit: Disconnected by services). (18:27:11) bvalek2_ is now known as bvalek2 (18:57:29) bvalek2 left the room (quit: Quit: Page closed). (19:50:30) bvalek2 [50bbda4a@gateway/web/freenode/ip.80.187.218.74] entered the room. (20:21:44) powerman-asdf: ☹ looks like bug in limbo (20:25:30) powerman-asdf: http://pastebin.com/Z1sKY5MX (20:26:06) powerman-asdf: looks like using sort.m somehow conflicts with loading modules with Command interface ?! (20:29:03) powerman-asdf: it generate run-time error like: link typecheck MemFS->SortData.gt() 0/9107053 (20:29:26) powerman-asdf: or: link typecheck Ls->SortData.gt() 0/9107053 (20:29:40) powerman-asdf: (depending on which module with Command interface we load) (20:30:15) powerman-asdf: except this module fail to load, everything else (sort itself) works ok (20:30:51) powerman-asdf: if we comment line which call sort->sort() - module with Command interface will load just fine (20:31:38) powerman-asdf: any ideas how to work around this (except go and report this issue to Charles)? (20:40:00) Fish- [~Fish@9fans.fr] entered the room. (21:04:32) powerman-asdf: another one issue: I'm trying to atomically update file by renaming (wstat) "file.new" to "file", where "file" already exists (of course, both files are in same dir) (21:05:13) powerman-asdf: looks like this works just fine on usual disk fs, but doesn't work on memfs (21:06:03) powerman-asdf: moreover, looks like standard "mv" always delete destination file before doing rename(wstat)! (21:07:56) powerman-asdf: is all that mean Inferno shouldn't be expected to support atomic file rename operation? (21:08:52) powerman-asdf: and how to reliably update file in this case? (22:47:47) Fish- left the room (quit: Read error: Operation timed out). (22:49:57) Fish- [~Fish@9fans.fr] entered the room. (23:19:44) bvalek2_ [50bbda4a@gateway/web/freenode/ip.80.187.218.74] entered the room. (23:19:55) bvalek2_ left the room (quit: Changing host). (23:19:55) bvalek2_ [50bbda4a@unaffiliated/bvalek2] entered the room. (23:19:55) bvalek2_ left the room (quit: Changing host). (23:19:55) bvalek2_ [50bbda4a@gateway/web/freenode/ip.80.187.218.74] entered the room. (23:19:55) bvalek2 left the room (quit: Disconnected by services). (23:19:56) bvalek2_ is now known as bvalek2 (23:28:24) Fish- left the room (quit: Quit: WeeChat 0.3.5). (00:21:59) bvalek2 left the room (quit: Quit: Page closed). (01:06:44) Guest98441 [U2FsdGVkX1@batman.acm.jhu.edu] entered the room. (01:06:49) Guest98441 is now known as vsrinivas (01:44:12) KBme left the room (quit: *.net *.split). (01:54:23) KBme [~KBme@2001:470:cabe:666:666:666:666:666] entered the room. (02:03:23) KBme left the room (quit: *.net *.split). (02:05:20) KBme [~KBme@2001:470:cabe:666:666:666:666:666] entered the room. (07:19:22) vpm left the room (quit: Ping timeout: 240 seconds). (09:23:43) vpm [~vpm@reverse-94.fdn.fr] entered the room. (11:05:18) bvalek2 [50bbd414@gateway/web/freenode/ip.80.187.212.20] entered the room. (15:34:00) bvalek2 left the room (quit: Ping timeout: 252 seconds). (16:47:57) bvalek2 [50bbd414@gateway/web/freenode/ip.80.187.212.20] entered the room. (17:06:02) bvalek2 left the room (quit: Ping timeout: 252 seconds). (17:16:38) bvalek2 [50bbd414@gateway/web/freenode/ip.80.187.212.20] entered the room. (19:55:06) bvalek2 left the room (quit: Quit: Page closed). (20:22:36) bvalek2 [50bb9f34@gateway/web/freenode/ip.80.187.159.52] entered the room. (21:19:18) Fish- [~Fish@9fans.fr] entered the room. (23:29:02) powerman-asdf: if some process run 20 threads, each doing sys->sleep(100) in a loop, and all threads start simultaneously (i.e. all 20 sleep()s also called nearly at same time), then emu uses ~1% CPU (23:30:05) powerman-asdf: BUT if we start these 20 threads with 5msec delay between spawns (i.e. all 20 sleep()s called one by one with 5msec delay), then emu uses ~10% CPU (23:30:45) powerman-asdf: anth_r, mjl-, vsrinivas: any ideas why this may happens? (23:39:14) powerman-asdf: looks like real difference here is how release() and acquire() are called: (23:39:54) powerman-asdf: either we call 20 times release(), then wait 100msec, then call 20 times acquire() (23:41:11) powerman-asdf: or we call first release(), wait 5msec, call second release(), wait 5msec, …, call twentieth release(), wait 5msec, call first acquire(), wait 5msec, call second acquire(), … (23:42:40) powerman-asdf: probably this somehow de-optimize inferno's scheduler? (23:57:46) mjl-: powerman-asdf1: perhaps the delays cause the gc to run for every context switch? whereas with all progs becoming ready at a single time they are all run before the gc is run? (23:57:48) mjl-: just an idea (00:00:32) bvalek2 left the room (quit: Quit: Page closed). (00:00:46) Fish- left the room (quit: Quit: WeeChat 0.3.5). (00:07:38) powerman-asdf: mjl-: thanks, looks like this. (00:08:07) powerman-asdf: I've added 'return' at beginning of execatidle(), and CPU usage lowered to 0% (01:18:42) powerman-asdf: Ok, so, it looks like if emu have 1 process, which is doing sleep(100) in a loop, then execatidle() is called 2 times per each sleep - i.e. 20 times per second (01:19:32) powerman-asdf: These 20 calls to execatidle() executes in 0.016 sec, i.e. about 2% CPU (01:22:31) powerman-asdf: So, each time you do timers->init(100) you lose 2% CPU. ☹ (03:26:47) vsrinivas: didn't realize it was that bad. (11:24:10) Fish left the room (quit: Read error: Operation timed out). (11:30:12) bvalek2 [50bb914b@gateway/web/freenode/ip.80.187.145.75] entered the room.