Beispiel #1
0
def main(argv):
	n = 100000
	loops = 1000
	threads = 0
	if len(argv) >= 4:
		n = int(argv[1])
		loops = int(argv[2])
		threads = int(argv[3])
		
	c = Creator(n, loops)
	if threads == 1:
		c.start()
		sleep(1000.0)
	else:
		c.body()
Beispiel #2
0
    def run(s):

        s.log.info('Started host node {0} on {1}'.format(s.nodename, s.address))

        # Make some count of creator
        for i in range(0, s.creators):

            # Create instance
            creator = Creator(s.nodename)

            # Run thread
            creator.start()

            # Logging
            s.log.info('Started creator thread: {0}'.format(creator.name))

        # Make connector
        connector = Connector(s.nodename)

        # Run connector thread
        connector.start()

        # Logging
        s.log.info('Started connector thread: {0}'.format(connector.name))