Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 27th, 2003, 02:57 PM
theperfectsoup theperfectsoup is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 35 theperfectsoup User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
Smile Random assorted questions :)

Hello... I'm hoping some people can provide some insight to the following:

1) Can I pass variables of primitive types (like ints, bools, longs, etc) by reference in Python, as in C++? If not, what's the best way to emulate this behavior -- to make a "wrapper" class for the primitive type, and to pass an object of this class holding the primitive type variable by reference?

2) I'm working a peer-to-peer program written in Python. Thus I need to make extensive use of Python's socket interface. I was wondering if any of you have ever written programs in Python that establish a large number of connections simultaneously (as in, between 16 and 32), and if so, when all these connections are idle, or barely using the bandwidth of your DSL/cable line, have you noticed any slowdown? I bring this up because my roommate complained that my using BitTorrent was slowing down his Internet connection significantly -- even though I was only downloading at 5K/sec, and we share a DSL line! A friend of mine related a similar experience with his roommate using BitTorrent. I'm hoping to attribute this to the way BitTorrent functions/how it is coded, and not Python itself.

Thanks!

- tps

Reply With Quote
  #2  
Old December 27th, 2003, 04:32 PM
percivall percivall is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 133 percivall User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
Well, as for (2): Remember that most DSL connections are half-duplex, which means that the total bandwidth is shared by downloading connections and uploading connections; even more, most DSL connections are asymmetric, which means that the download bandwidth and the upload bandwidth are different in magnitude. But even if your upload bandwidth is less than your download bandwidth, the total bandwidth is shared as if they were equal. If you use half your upload bandwidth, half your download bandwidth will be gone.

Reply With Quote
  #3  
Old December 27th, 2003, 06:19 PM
theperfectsoup theperfectsoup is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 35 theperfectsoup User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
Hrmmm, point noted percivall. Although I remember uploading at only 5K/sec as well, so that might not have been the issue.

Thanks for the info, however. As for point #1, ignore it -- I figured something out

- tps

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Random assorted questions :)

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap