Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
lol if you
Jun 29, 2004

I am going to remove your penis, in thin slices, like salami, just for starters.

ChiralCondensate posted:

i just shrug and say "rcs suits my needs"

Adbot
ADBOT LOVES YOU

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

ChiralCondensate posted:

i just shrug and say "a shared folder with our code in it suits our team's needs"

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
reminder that for years visual source safe was sold by microsoft as a legit source control system for use by developers while ms themselves used some custom version of perforce and are now migrating to tfs which is based on an internal custom source control system they also used

lol if you
Jun 29, 2004

I am going to remove your penis, in thin slices, like salami, just for starters.

Cold on a Cob posted:

reminder that for years visual source safe was sold by microsoft as a legit source control system for use by developers while ms themselves used some custom version of perforce and are now migrating to tfs which is based on an internal custom source control system they also used


perforce owns if you got money

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

lol if you posted:

perforce owns if you got money

i've never used it but i like svn and tfs both have done me solid so far, what does perforce do better?

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
dogfooding means "no, don't eat that! that's dog food, for christ's sake. gross!"

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
if u think about it the source code to vss was stored in a perforce repo probably lol

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

lol if you posted:

perforce owns if you got money

perforce is loving awful, tell you what, give me the money you would give perforce and use svn instead and save your self a ton of poo poo

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Cold on a Cob posted:

if u think about it the source code to vss was stored in a perforce repo probably lol

it must have been; had it been in a vss 'repository' it would have been lost almost instantaneously

Shaggar
Apr 26, 2006
taking the time to setup proper svn + maven repos is one of the best things i ever did.

Egan Yardley
Jun 11, 2010

Shaggar posted:

taking the time to setup proper svn + maven repos is one of the best things i ever did.
droppin' truth bombs

Shaggar
Apr 26, 2006
next on the list is a hudson but i dont have the time for it.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
takin time to setup a mercurial repo was one of the best things i ever did

hg init

salted hash browns
Mar 26, 2007
ykrop
I've got a serious shaggar java question:

Shaggar, I've got a HashMap (i'm dumb) that is being accessed by a bunch of threads. generally they do something like:

code:
Object myvar = hashmap.get(key);
//compare my var to some things
//change value of myvar
hashmap.put(key, myvar);
so naturally I'm thinking about doing something like this:
code:
synchronized(hashmap) {
    //all that poo poo up there
}
but I haven't done concurrent programming in a while and don't know if that is the best way of doing things. I am googling and finding all these other things (ArrayBlockingQueue, ConcurrentLinkedQueue, LinkedBlockingQueue, etc) and don't know when i should use which one.

Also if I have a linked list and I
code:
if (linkedlist.size() >= 60) linkedlist.removeFirst(); //do this to keep the list always with the latest 60 entries
does that leak memory (i think it does).

salted hash browns fucked around with this message at 16:47 on Nov 1, 2012

coaxmetal
Oct 21, 2010

I flamed me own dad
git suits my needs. So does SVN, mostly, though I do have a few small issues wit it.

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

salted hash browns posted:

I've got a serious shaggar java question:

Shaggar, I've got a LinkedList that is being accessed by a bunch of threads. generally they do something like:

code:
Object myvar = linkedlist.get(key);
//compare my var to some things
//change value of myvar
linkedlist.put(key, myvar);
so naturally I'm thinking about doing something like this:
code:
synchronized(linkedlist) {
    //all that poo poo up there
}
but I haven't done concurrent programming in a while and don't know if that is the best way of doing things. I am googling and finding all these other things (ArrayBlockingQueue, ConcurrentLinkedQueue, LinkedBlockingQueue, etc) and don't know when i should use which one.

Also if I have a linked list and I
code:
if (linkedlist.size() >= 60) linkedlist.removeFirst(); //do this to keep the list always with the latest 60 entries
does that leak memory (i think it does).

http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Collections.html#synchronizedList%28java.util.List%29

salted hash browns
Mar 26, 2007
ykrop

ty. what happens if you use syncronized(list) with a non-sync'd list? does it just use the object as a lock? what difference does it make?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Cold on a Cob posted:

i've never used it but i like svn and tfs both have done me solid so far, what does perforce do better?
sharing shitloads of files between projects, like if you keep your toolchain in version control for repeatable building

although for this to be effective you have to build a culture where people will tell p4 to copy file objects instead of adding new instances of them, and some people just will not loving do this

and maybe tfs does object sharing now, i only used the first release and it was clunky as hell

Gazpacho fucked around with this message at 16:52 on Nov 1, 2012

salted hash browns
Mar 26, 2007
ykrop

salted hash browns posted:

I've got a serious shaggar java question:

Shaggar, I've got a HashMap (i'm dumb) that is being accessed by a bunch of threads. generally they do something like:

code:
Object myvar = hashmap.get(key);
//compare my var to some things
//change value of myvar
hashmap.put(key, myvar);
so naturally I'm thinking about doing something like this:
code:
synchronized(hashmap) {
    //all that poo poo up there
}
but I haven't done concurrent programming in a while and don't know if that is the best way of doing things. I am googling and finding all these other things (ArrayBlockingQueue, ConcurrentLinkedQueue, LinkedBlockingQueue, etc) and don't know when i should use which one.

Also if I have a linked list and I
code:
if (linkedlist.size() >= 60) linkedlist.removeFirst(); //do this to keep the list always with the latest 60 entries
does that leak memory (i think it does).

I am dumb and confused my first variable type with second. First question is re: synched hashmaps. 2nd is linked lists.

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

salted hash browns posted:

ty. what happens if you use syncronized(list) with a non-sync'd list? does it just use the object as a lock? what difference does it make?

yes i think and it makes a difference in which object you are blocking on. i think having a method as synchronized will use the parent (?) object as the lock

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

salted hash browns posted:

I am dumb and confused my first variable type with second. First question is re: synched hashmaps. 2nd is linked lists.

use the synchronized versions of both and hopefully it won't be a problem but remember that in legacy languages like java and c multi-threaded programming is really difficult and if poo poo doesn't work right it'll be really hard to debug

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Collections.html#synchronizedMap%28java.util.Map%29

this will also help

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

Cocoa Crispies posted:

use the synchronized versions of both and hopefully it won't be a problem but remember that in legacy languages like java and c multi-threaded programming is really difficult and if poo poo doesn't work right it'll be really hard to debug

your mom is legacy :colbert:

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
one time working on p4 project i had a popup window steal the focus just as I hit enter and this deleted all 6000 files in the project toolchain (e: on the server, dummy) i was able to recover without uploading the files again by saying "those file versions i deleted, just map them back into the project ok" :cool:

Gazpacho fucked around with this message at 18:07 on Nov 1, 2012

salted hash browns
Mar 26, 2007
ykrop

ty.

what is the difference between using synchronized(object), synchronized(hashmap) and synchronized(synchronizedhashmap)?

Shaggar
Apr 26, 2006

salted hash browns posted:

I've got a serious shaggar java question:

Shaggar, I've got a LinkedList that is being accessed by a bunch of threads. generally they do something like:

code:
Object myvar = linkedlist.get(key);
//compare my var to some things
//change value of myvar
linkedlist.put(key, myvar);
so naturally I'm thinking about doing something like this:
code:
synchronized(linkedlist) {
    //all that poo poo up there
}
but I haven't done concurrent programming in a while and don't know if that is the best way of doing things. I am googling and finding all these other things (ArrayBlockingQueue, ConcurrentLinkedQueue, LinkedBlockingQueue, etc) and don't know when i should use which one.

Also if I have a linked list and I
code:
if (linkedlist.size() >= 60) linkedlist.removeFirst(); //do this to keep the list always with the latest 60 entries
does that leak memory (i think it does).

tbh i dont deal much w/ concurrency. from what little i know about the concurrent collections stuff they're use really really depends on what operations you're doing on the object. like mostly reads w/ few writes vs lots of writes w/ few reads. for you it may be a case where synchronized suits your needs the best, but its gonna take research if you want to find the best performance for your application. if you dont care about performace then just pick one. You probably had a reason to pick linkedlist over arraylist tho so i assume performance is a concern.

in regards to memory leaks, removeFirst() should not cause a leak. my assumption is that the object you are removing when you do removeFirst() still has a valid reference somewhere in your code that is causing the leak. Thats a very common multithreading mistake too so its probably whats going on. If you want to know what still has it open, theres a memory leak detector for eclipse that i dont remember the name of but is pretty good.

Alternatively, you can maybe rethink if you actually need a concurrent collection -OR- if you can simplify how the data is accessed in the collection to prevent those kind of leaks.

Shaggar
Apr 26, 2006
if ur using a hashmap try a concurrenthashmap. Also, i assumed both questions were about concurrency on the linkedlist so if you arent sharing the linked list then the memory leak is probably not related to multithreading and probably just a plain old leak in ur code. should be easier to find with a leak detector.

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

salted hash browns posted:

ty.

what is the difference between using
1. synchronized(object)
2. synchronized(hashmap)
3. synchronized(synchronizedhashmap)?

they are all the same, but using different objects for the lock, but 3 is unnecessary

just guessing tbh i forget most of concurrency

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Gazpacho posted:

one time working on p4 project i had a popup window steal the focus just as I hit enter and this deleted all 6000 files in the project toolchain, i was able to recover without uploading the files again by saying "those file versions i deleted, just map them back into the project ok" :cool:

one time working on git project i didn't have popup windows steal the focus

tef
May 30, 2004

-> some l-system crap ->
i'd say whack a class in called 'BobsSharedObject'. Put a private lock in it, and use explicit synchronization inside the methods. then, replace it with nicer concurrent structures/atomic types later.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

Gazpacho posted:

one time working on p4 project i had a popup window steal the focus just as I hit enter and this deleted all 6000 files in the project toolchain, i was able to recover without uploading the files again by saying "those file versions i deleted, just map them back into the project ok" :cool:

you used a version control for its exact purpose. congrats on not being a drooling retard i guess

also agreed: lol about a version control system that 1) needs a gui to be usable 2) has a gui with focus stealing popups

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Wheany posted:

takin time to setup a mercurial repo was one of the best things i ever did

hg init

Same, it really was useful because our lovely internet connection would always fuckup the SVN commits.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Lysidas posted:

you used a version control for its exact purpose. congrats on not being a drooling retard i guess

also agreed: lol about a version control system that 1) needs a gui to be usable 2) has a gui with focus stealing popups
Yeah I was just thinking someone might read that post and be as stupid as you, no i deleted those files on the server and any other system would have made me upload them again

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
The progrAm that stole focus was a local tool

I bet u could write a git program that steals the focus too, I bet u could

Gazpacho fucked around with this message at 18:13 on Nov 1, 2012

Opinion Haver
Apr 9, 2007

Gazpacho posted:

Yeah I was just thinking someone might read that post and be as stupid as you, no i deleted those files on the server and any other system would have made me upload them again

git reset to the commit before you killed everything, or git revert the commit that killed everything

done

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
or even if yo'ure using a vcs for idiots, svn remove whole directory; svn copy directory@{rev before you hosed up} directory

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Gazpacho posted:

Yeah I was just thinking someone might read that post and be as stupid as you, no i deleted those files on the server and any other system would have made me upload them again

lmao the whole point of version control is so you can delete files and get them back

smdh if the trash one you use makes a distinction between "server" and not-server

Shaggar
Apr 26, 2006
yeah why would version control need control?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

yaoi prophet posted:

git reset to the commit before you killed everything, or git revert the commit that killed everything

done
Look I like git but even git can't map the same file object to multiple locations or recover a pushed deletion without copying the file, perforce can do that poo poo

Adbot
ADBOT LOVES YOU

Max Facetime
Apr 18, 2009

the git plugin in the latest freshly unzipped eclipse pops up 2 dialog windows if it can't find git

in those dialogs it kind of weakly apologizes that it can function just as well without using a real git, it's pretty :catstare:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply