@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10



Comments:

<0> as a result i tend to prefer dotlocking, which can easily be tested in any sub-script/program started.
<0> they can be combined i suppose, along the lines acid- suggested.
<1> hmm.. well
<1> my flock is done from perl
<1> I have utility scripts written in shell script (bash)
<2> can't you use a ghetto style flock with a filename.lock ?
<1> .locking won't work because I have hundreds of thousands of resources hit randomly at high volume
<1> what if I make 0 byte files named single letters and store those and flock them, by the way?
<1> I'd have 4 of them per directory, and 200 directories, each directory having 1000 sub dirs
<2> hope you're not using ext3
<1> so 200,000 subdirs total, each having 4 files in it for now.
<2> if so that'll be a bit slow
<1> using ext3
<2> ouch ;(
<2> dont' do that



<2> ext3 is terrible with deep dirs like that
<1> I'd convert to Reiser or something but not yet on this server.. maybe on the new server
<1> it's only a couple levels deep?
<1> actually it's very deep.. but then branches
<2> you can try it
<1> it's /1/2/3/4/5/6/{200-dirs}/{1000-dirs}/{6 files}
<1> which is bad, I think.
<1> I wonder what kind of performance increase there is in moving, say, the /6/ to root
<2> 1000 dirs in a single parent?
<1> yeah
<2> you're asking to have slow operations ;D
<1> :(
<2> ext3 will eat up 100's of megs of drive space just to create your structure, even with 0 files
<2> well maybe ot 100's but at least 100megs probably
<2> that's how inefficient ext3 is for that
<1> what dir structure would be best under what best fs?
<2> i can't comment on that, cause i use UFS on freebsd
<2> but i do know ext3 isn't what you want
<0> heh.
<1> we may switch to OpenBSD when we get a new server
<0> zero length files don't take all that much space, even with ext3.
<2> it's the strucure that does
<2> look at his structure
<2> he doesn't even need files
<0> though for locking stuff i'd suggest using memory based filesystem.
<1> for locking I was using a flock() method where I had two files in each of those subdirs
<1> but I don' tlike leaving the flock files around.. 400,000 of them?
<2> holy****
<1> and removing them is a bad problem with flock()
<2> listen to what twkm has to say
<2> ramdisk
<2> ?
<1> what I'm using now is fcntl() set lock calls on a single file
<2> is what he's suggesting i think
<0> shared memory would likely be even better, but it needs cooperation, and the other application doesn't seem to use it.
<1> each resource is represented by a single byte in the file
<2> jaggy: i hate offering stupid ideas, but is there any way to just port the bash to perl?
<1> then I have my C routines which lock a byte (shared or exclusive) to lock the resource
<2> since that's what you're using right
<2> or port it to C
<1> well.. the offline scripts are a secondary issue.. the primary issue is the web-side of things, which is all in C
<0> Jaggy_: okay, so your locking is already done. i suggest you do it util-linux style, where you run a program after you obtain the lock.
<3> Jaggy_: use some sort of hashing and mod the result number twice, make 10*10 directories
<1> twkm, but the fcntl method is new, and I'm not sure how fast it is.. it seems like it might be kind of slow so far (put the new version on a couple days ago)
<1> how would you handle the memory-based fs?
<1> we have /dev/shm/ (shared memory)
<0> Jaggy_: fcntl needs the kernel. you might be able to get away with lock-free if you stay in user-space.
<2> can a chroot disable shared mem?
<2> like a jail can
<1> I tried semaphores and stuff.. but nothing seemed to work..
<0> feti_: doubtful.
<1> specifically because I have 200,000 groups on the site.. and each one has some different resources (settings, message database, notes file, etc.)
<0> Jaggy_: semaphores didn't work?!?!?
<0> they should be functional.
<2> isnt' there an issue with the limit of semaphores
<2> surely a system cannot have 400,000 open semaphores
<1> they work, but coming up with a way of handling it was bad
<1> I had to group things into a certain number of semaphores.. then I had to begin storing process IDs to check if a child died
<0> feti: quite possible, yes. shared memory would ease that issue.
<0> feti: though Jaggy_ seems to need quite a lot of state.
<1> and semaphores tend to use ftok() to generate a unique id .. and that seems to stat if I recall correctly



<4> i agree. it almost sounds like it's a bad design *gulp*
<4> if you need 400k of them open, something's probably wrong
<4> usually that's the last resort to mention since i don't know his level of coding
<1> hmm
<1> feti, he's been around a while.. seems to know quite a bit.
<1> usually he's very helpful and pretty nice to me
<4> jaggy: your dev? that's who i was talking a bout ;P
<4> i honestly don't know, but this sort of sounds like "Why the heck do we need 400k open locks?"
<1> I only need a certain amount at a time.. basically whatever the webserver needs for its connections and some offline stuff
<4> oh ok
<1> so really only in the hundreds probably
<4> so you really don't need 400k simultanesouly
<1> right.. no I don't
<4> that's much more doable ;P
<1> :)
<3> whats the purpose of locking the file?
<1> the site will usually have one shared lock (when it opens and loads the forum settings) and if it access the forum's message database it gets another lock on that (shared for read, exclusive for writing)
<5> can someone point out a visual cvs branch/tag analisys tool?
<1> acid, locking various community resources
<6> hello. how can I get longip?
<4> ip2long()
<4> woops, i thought i was in #php
<4> sorry about that
<5> chaunt: from what?
<5> a dot ip string or a hostname?
<5> or from a sockaddr struct
<5> need more details
<6> well I connected to it, I have sockaddtr
<1> I moved the res_locks file to /dir/reslocks
<1> one dir deep now..
<1> all the groups are in the deep subdirs.. I should move that..
<1> but how would you organize 200,000 groups, each with a minimum of 4 files?
<1> (settings, messages, settings backup, messages backup, notes, misc admin stuff we leave laying around)
<1> each group has those files
<7> How can I declare a 2 dimensional array if I already know the values like: char array[][] = { "string1", "string2", "string3" }; /* that doesn't seem to work */
<1> I used to know something about that.. now I'd just use char *array[]={same stuff};
<1> it has something to do with not knowing the size of the leaves
<8> you can't do it that way.. do it char *array[] == { "string1", "string2" }
<7> ok works fo rme
<7> thanks both
<1> leaves.. what a weird word
<1> is there any directory which I should not chattr +A ??
<9> hmm.
<9> I'm beginning to think C is not as popular as it used to be.
<10> Jaggy_, my whole file systems are on noatime
<4> the language itself or the channel
<9> the language, and therefore the channel
<4> everybody's trading it in for interpreted, easier to code languages that save development time
<4> everybody's throwing $ at cpu's and ram
<3> yup
<10> "everybody" wouldn't be accurate there though
<4> correct
<8> which is really dumb
<4> don't blame the developers, blame the suits
<8> just because the things are so much more capable now doesn't make it a goodea to be wastefull
<4> you cannot work for a large company nowadays and code stuff properly unless you are at the top of the chain yourself
<10> For heavy number crunching software, there's nothing like C really
<4> jeff: we all agree.
<8> blame the universitys teaching whatever the fads happen to be current
<10> Depends what the software does, feti
<4> otherwise we'd be in #java
<4> java isn't a bad language if you ask me. figured i'd throw that in.
<10> I find no use where Java would be the most appropriate language
<8> I hate it. look at all the extra crap it drags into ram before it even gets to doing the actual java code
<11> Maloeran: I agree
<12> ls
<13> I'm tryna do dognuts
<0> yay dog nuts.
<13> sup twkm
<13> a nigga about to go do dougnuts
<0> i've considered it as well.
<0> but my damn dsl is acting like ****, so instead i'll spend my copious free time (not!) stuck on hold.
<13> you aint tryna do dougnuts out in the parking lot?
<0> dognuts in the chair. staring at the phone, which is playing music instead of fixing things.


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c
or
Go to some related logs:

#stocks
#online
firebird grafic client
#heroin
Flash MX scrollable_text
#nhl
#bsd
#photoshop
#winxp
#qmail



Home  |  disclaimer  |  contact  |  submit quotes