FAQ
Hi mate

i need o do a python program to connect 2 systems using TCP/IP and
UDP. Also i need to check the performance of these two protocols (how
many bytes received and how much time took). I havent worked in python
earlier and have no idea of this. Could someone pls help me. I created
a program which can connect between 2 systems using these UDP and TCP/
IP protocols. I dont know how to check the rest like how many bytes
send or how much time taken
since this is part of my course work could someone please help me
thanks in advance.

tijo

From http Fri Jan 11 03:22:35 2008
From: http (Paul Rubin)
Date: 10 Jan 2008 18:22:35 -0800
Subject: Best way to merge/sort two sorted lists?...
References: <1230064b-603d-4386-b68c-a913c5cf80d3@s12g2000prg.googlegroups.com>
<60572417-9e83-4d0c-80da-2c99a9bd19e4@b40g2000prf.googlegroups.com>
<slrnflgidl.27g.horpner@FIAD06.norwich.edu>
<232c569b-783a-43b8-bdb0-2d578bac037b@s8g2000prg.googlegroups.com>
Message-ID: <7xfxx5cd90.fsf@ruckus.brouhaha.com>

Aaron Watters <aaron.watters at gmail.com> writes:
The second one is! That's why it works so fast.
Tim Peters optimized this case!
Gotta hand it to Tim Peters. The first one should
win some sort of obfuscated code contest, imho.
It also seems to be 5 times slower than any of the others.
The heapq method is the right way to do it when you want to
merge n lists instead of two lists. Each selection takes O(log n)
operations.

From http Fri Jan 11 03:28:45 2008
From: http (Paul Rubin)
Date: 10 Jan 2008 18:28:45 -0800
Subject: Minimalistic Software Transactional Memory
References: <13lm7nd85v7jk70@corp.supernews.com>
<e43b1318-6e47-4459-9db6-ede1f4060b24@e67g2000hsc.googlegroups.com>
<13lmemmsnjuhm04@corp.supernews.com>
<6b14fcf9-9549-422b-b837-afa5b32cf7f2@n20g2000hsh.googlegroups.com>
Message-ID: <7xbq7tccyq.fsf@ruckus.brouhaha.com>

Fuzzyman <fuzzyman at gmail.com> writes:
STM isn't lock free - it just abstracts the locks away from the
'user'. You still need to lock around committing the transaction.
The idea is that readers don't need locks. They just look at the
version number before they start reading and after they finish. If
the number didn't change, the read was successful. If it changed,
they have to retry.

On multiprocessor systems this relies on an instruction like CMPXCHG
for writers to increment the version number. Otherwise it requires a
lock separate from the version number, and multiple operations on the
lock.

Search Discussions

  • Devraj at Jan 11, 2008 at 2:31 am
    Sorry to diverge from the topic, but is there a reason you need to
    develop something like again? I would assume that there would be
    numerous utilities that would do this for you.

    If you want these features in your applications, why don't you
    consider incorporating existing tools/libraries into your program.

    Just trying to reason why you would want to write a network metrics
    program over again.
    On Jan 11, 1:15 pm, tijo wrote:
    Hi mate

    i need o do a python program to connect 2 systems using TCP/IP and
    UDP. Also i need to check the performance of these two protocols (how
    many bytes received and how much time took). I havent worked in python
    earlier and have no idea of this. Could someone pls help me. I created
    a program which can connect between 2 systems using these UDP and TCP/
    IP protocols. I dont know how to check the rest like how many bytes
    send or how much time taken
    since this is part of my course work could someone please help me
    thanks in advance.

    tijo
  • Bjoern Schliessmann at Jan 11, 2008 at 8:24 pm

    Devraj wrote:

    Sorry to diverge from the topic, but is there a reason you need to
    develop something like again?
    It's obvious, isn't it?
    On Jan 11, 1:15 pm, tijo wrote:
    I dont know how to check the rest like how many bytes send or how
    much time taken since this is part of my course work could
    someone please help me thanks in advance.
    Homework.

    Regards,


    Bj?rn

    --
    BOFH excuse #183:

    filesystem not big enough for Jumbo Kernel Patch
  • Ivan Novick at Jan 11, 2008 at 4:29 am

    On Jan 10, 6:15 pm, tijo wrote:
    Hi mate

    i need o do a python program to connect 2 systems using TCP/IP and
    UDP. Also i need to check the performance of these two protocols (how
    many bytes received and how much time took). I havent worked in python
    earlier and have no idea of this. Could someone pls help me. I created
    a program which can connect between 2 systems using these UDP and TCP/
    IP protocols. I dont know how to check the rest like how many bytes
    send or how much time taken
    since this is part of my course work could someone please help me
    thanks in advance.

    tijo
    So you want to write a program using sockets then?

    http://docs.python.org/lib/module-socket.html

    Regards,
    Ivan Novick
    http://www.0x4849.net
  • Tijo at Jan 11, 2008 at 4:51 am
    Hi mate
    i created the socket and the connection with tcp and udp i dont know
    how to check the bytes send and time
    could you help me with this

    cheers
    tijo
  • A.T.Hofkamp at Jan 11, 2008 at 7:47 am

    On 2008-01-11, tijo wrote:
    Hi mate
    i created the socket and the connection with tcp and udp i dont know
    how to check the bytes send and time
    could you help me with this
    Have a look at the time or timeit modules.

    Albert
  • Hyuga at Jan 11, 2008 at 2:49 pm

    On Jan 10, 9:15 pm, tijo wrote:
    Hi mate

    i need o do a python program to connect 2 systems using TCP/IP and
    UDP. Also i need to check the performance of these two protocols (how
    many bytes received and how much time took). I havent worked in python
    earlier and have no idea of this. Could someone pls help me. I created
    a program which can connect between 2 systems using these UDP and TCP/
    IP protocols. I dont know how to check the rest like how many bytes
    send or how much time taken
    since this is part of my course work could someone please help me
    thanks in advance.

    tijo
    The standard library documentation, while lacking in some areas, is
    very much your friend here:
    send(string[, flags])
    Send data to the socket. The socket must be connected to a remote
    socket. The optional flags argument has the same meaning as for recv()
    above. *Returns the number of bytes sent.*

    recv(bufsize[, flags])
    Receive data from the socket. The return value is a string
    representing the data received.

    For timing you can probably use the timeit module (http://
    docs.python.org/lib/module-timeit.html) but I'm not really sure how
    you're defining "performance". I mean, I can already tell you that
    overall UDP will be "faster", as it has much less overhead. Surely
    your course has covered this...

    Hyuga

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJan 11, '08 at 2:15a
activeJan 11, '08 at 8:24p
posts7
users6
websitepython.org

People

Translate

site design / logo © 2022 Grokbase